LittleEndianDecoder

Struct LittleEndianDecoder 

Source
pub struct LittleEndianDecoder<E> { /* private fields */ }

Implementations§

Source§

impl<E> LittleEndianDecoder<E>

Source

pub fn new(buf: Bytes) -> Self

Source

pub fn into_inner(self) -> Bytes

Trait Implementations§

Source§

impl<E: Debug> Debug for LittleEndianDecoder<E>

Source§

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

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

impl<'de, E: Error> Decoder<'de> for LittleEndianDecoder<E>

Source§

type Buf = Bytes

Source§

type Error = E

Source§

fn buf(&self) -> &Self::Buf

inner buffer
Source§

fn buf_mut(&mut self) -> &mut Self::Buf

inner buffer
Source§

fn decode_sized<V: Visitor<'de>>( &mut self, size: usize, visitor: V, ) -> Result<V::Value, Self::Error>
where Self: Sized,

take specified number of bytes, and decode it with the specified visitor
Source§

fn ensure_size(&self, expected: usize) -> Result<(), Self::Error>

check remaining buffer size
Source§

fn decode_any<T>(&mut self) -> Result<T, Self::Error>
where T: Decode<'de>, Self: Sized,

decode any type T that derive Decode
Source§

fn decode_bool(&mut self) -> bool

get bool unchecked
Source§

fn decode_i8(&mut self) -> i8

get i8 unchecked
Source§

fn decode_u8(&mut self) -> u8

get u8 unchecked
Source§

fn decode_i16(&mut self) -> i16

get i16 unchecked
Source§

fn decode_u16(&mut self) -> u16

get u16 unchecked
Source§

fn decode_i32(&mut self) -> i32

get i32 unchecked
Source§

fn decode_u32(&mut self) -> u32

get u32 unchecked
Source§

fn decode_i64(&mut self) -> i64

get i64 unchecked
Source§

fn decode_u64(&mut self) -> u64

get u64 unchecked
Source§

fn decode_f32(&mut self) -> f32

get f32 unchecked
Source§

fn decode_f64(&mut self) -> f64

get f64 unchecked
Source§

fn decode_i128(&mut self) -> i128

get i128 unchecked
Source§

fn decode_u128(&mut self) -> u128

get u128 unchecked
Source§

fn remaining(&mut self) -> usize

Source§

fn has_remaining(&mut self) -> bool

Source§

fn decode_with<V: Visitor<'de>>( &mut self, visitor: V, ) -> Result<V::Value, Self::Error>
where Self: Sized,

decode with a dedicated Visitor. A Visitor gives you some context information while decoding.

Auto Trait Implementations§

§

impl<E> !Freeze for LittleEndianDecoder<E>

§

impl<E> RefUnwindSafe for LittleEndianDecoder<E>
where E: RefUnwindSafe,

§

impl<E> Send for LittleEndianDecoder<E>
where E: Send,

§

impl<E> Sync for LittleEndianDecoder<E>
where E: Sync,

§

impl<E> Unpin for LittleEndianDecoder<E>
where E: Unpin,

§

impl<E> UnwindSafe for LittleEndianDecoder<E>
where E: UnwindSafe,

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>,

Source§

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>,

Source§

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.