Struct push_decode::decoders::U8Decoder
source · pub struct U8Decoder { /* private fields */ }Implementations§
Trait Implementations§
source§impl Decoder for U8Decoder
impl Decoder for U8Decoder
§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 RefUnwindSafe for U8Decoder
impl Send for U8Decoder
impl Sync for U8Decoder
impl Unpin for U8Decoder
impl UnwindSafe for U8Decoder
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