pub struct ByteArrayDecoder<const N: usize> { /* private fields */ }Implementations§
Trait Implementations§
Source§impl<const N: usize> Debug for ByteArrayDecoder<N>
impl<const N: usize> Debug for ByteArrayDecoder<N>
Source§impl<const N: usize> Decoder for ByteArrayDecoder<N>
impl<const N: usize> Decoder for ByteArrayDecoder<N>
Source§type Error = UnexpectedEnd
type Error = UnexpectedEnd
Decoding error.
Source§fn decode_chunk(&mut self, bytes: &mut &[u8]) -> Result<(), Self::Error>
fn decode_chunk(&mut self, bytes: &mut &[u8]) -> Result<(), Self::Error>
Processes nex chunk of bytes and updates the cursor. Read more
Source§fn end(self) -> Result<Self::Value, Self::Error>
fn end(self) -> Result<Self::Value, Self::Error>
Called when decoding has ended or there are no more bytes. Read more
Source§fn bytes_received(&mut self, bytes: &[u8]) -> Result<usize, Self::Error>
fn bytes_received(&mut self, bytes: &[u8]) -> Result<usize, Self::Error>
Processes nex chunk of bytes without updating the cursor. Read more
Source§fn then<R: Decoder, F: FnOnce(Self::Value) -> R>(
self,
fun: F,
) -> Then<Self, R, F>
fn then<R: Decoder, F: FnOnce(Self::Value) -> R>( self, fun: F, ) -> Then<Self, R, F>
Chains another decoder after this one finishes such that the value of this one is used to
initialize the next one.
Source§fn then_try<E, R: Decoder, F: FnOnce(Self::Value) -> Result<R, E>>(
self,
fun: F,
) -> ThenTry<E, Self, R, F>
fn then_try<E, R: Decoder, F: FnOnce(Self::Value) -> Result<R, E>>( self, fun: F, ) -> ThenTry<E, Self, R, F>
Chains another decoder after this one finishes such that the value of this one is used to
initialize the next one. Read more
Source§fn chain<D: Decoder>(self, following: D) -> Chain<Self, D>
fn chain<D: Decoder>(self, following: D) -> Chain<Self, D>
Chains another decoder after this one to decode two values.
Source§fn take(&mut self) -> Result<Self::Value, Self::Error>where
Self: Default,
fn take(&mut self) -> Result<Self::Value, Self::Error>where
Self: Default,
Resets the decoder returning the decoded value.
Source§fn sub_decode<E, F: FnMut(Self::Error) -> E>(
&mut self,
bytes: &mut &[u8],
map_err: F,
) -> ControlFlow<Result<(), E>, Self::Value>where
Self: Default,
fn sub_decode<E, F: FnMut(Self::Error) -> E>(
&mut self,
bytes: &mut &[u8],
map_err: F,
) -> ControlFlow<Result<(), E>, Self::Value>where
Self: Default,
Decodes a value from lower-level decoder. Read more
Source§fn wrap_sub_decode<F: FnOnce() -> ControlFlow<Result<(), Self::Error>, Infallible>>(
f: F,
) -> Result<(), Self::Error>
fn wrap_sub_decode<F: FnOnce() -> ControlFlow<Result<(), Self::Error>, Infallible>>( f: F, ) -> Result<(), Self::Error>
Helper for using sub_decode. Read more
Auto Trait Implementations§
impl<const N: usize> Freeze for ByteArrayDecoder<N>
impl<const N: usize> RefUnwindSafe for ByteArrayDecoder<N>
impl<const N: usize> Send for ByteArrayDecoder<N>
impl<const N: usize> Sync for ByteArrayDecoder<N>
impl<const N: usize> Unpin for ByteArrayDecoder<N>
impl<const N: usize> UnwindSafe for ByteArrayDecoder<N>
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more