Struct lock_keeper::crypto::generic::ParseBytes
source · pub(super) struct ParseBytes {
bytes: Vec<u8>,
offset: usize,
}
Expand description
Helper type for parsing byte array into integers and slices.
Fields§
§bytes: Vec<u8>
§offset: usize
Implementations§
source§impl ParseBytes
impl ParseBytes
pub fn new(bytes: Vec<u8>) -> ParseBytes
sourcepub fn take_bytes(&mut self, n: usize) -> Result<&[u8], CryptoError>
pub fn take_bytes(&mut self, n: usize) -> Result<&[u8], CryptoError>
Take next n
bytes from array.
sourcepub fn take_bytes_as_u16(&mut self) -> Result<u16, CryptoError>
pub fn take_bytes_as_u16(&mut self) -> Result<u16, CryptoError>
Take next two bytes and convert them into a u16.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ParseBytes
impl RefUnwindSafe for ParseBytes
impl Send for ParseBytes
impl Sync for ParseBytes
impl Unpin for ParseBytes
impl UnwindSafe for ParseBytes
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request