pub struct U8Decoder { /* private fields */ }

Implementations§

source§

impl U8Decoder

source

pub fn new() -> Self

Trait Implementations§

source§

impl Debug for U8Decoder

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Decoder for U8Decoder

§

type Value = u8

The type of value produced by this decoder.
§

type Error = UnexpectedEnd

Decoding error.
source§

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>

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>

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>

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>
where E: From<Self::Error> + From<R::Error>,

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>

Chains another decoder after this one to decode two values.
source§

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,

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>

Helper for using sub_decode. Read more
source§

impl Default for U8Decoder

source§

fn default() -> U8Decoder

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.