Skip to main content

FromLeStream

Trait FromLeStream 

Source
pub trait FromLeStream: Sized {
    // Required method
    fn from_le_stream<T>(bytes: T) -> Option<Self>
       where T: Iterator<Item = u8>;

    // Provided methods
    fn from_le_stream_exact<T>(bytes: T) -> Result<Self>
       where T: Iterator<Item = u8> { ... }
    fn from_le_slice(bytes: &[u8]) -> Result<Self> { ... }
}
Expand description

Parse an object from a stream of bytes with little endianness.

Required Methods§

Source

fn from_le_stream<T>(bytes: T) -> Option<Self>
where T: Iterator<Item = u8>,

Parse an object from a stream of bytes with little endianness.

§Errors

Returns None if the stream terminates prematurely.

Provided Methods§

Source

fn from_le_stream_exact<T>(bytes: T) -> Result<Self>
where T: Iterator<Item = u8>,

Parse an object from a stream of bytes with little endianness that contains exactly the bytes to construct Self.

§Errors

Returns an Error if the stream terminates prematurely or is not exhausted after deserializing Self.

Source

fn from_le_slice(bytes: &[u8]) -> Result<Self>

Parse an object from a slice of bytes with little endianness that contains exactly the bytes to construct Self.

§Errors

Returns an Error if the buffer is too small or contains excess data.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl FromLeStream for Infallible

Source§

fn from_le_stream<T>(_: T) -> Option<Self>

Source§

impl FromLeStream for bool

Source§

fn from_le_stream<T>(bytes: T) -> Option<Self>
where T: Iterator<Item = u8>,

Source§

impl FromLeStream for f32

Source§

fn from_le_stream<T>(bytes: T) -> Option<Self>
where T: Iterator<Item = u8>,

Source§

impl FromLeStream for f64

Source§

fn from_le_stream<T>(bytes: T) -> Option<Self>
where T: Iterator<Item = u8>,

Source§

impl FromLeStream for i8

Source§

fn from_le_stream<T>(bytes: T) -> Option<Self>
where T: Iterator<Item = u8>,

Source§

impl FromLeStream for i16

Source§

fn from_le_stream<T>(bytes: T) -> Option<Self>
where T: Iterator<Item = u8>,

Source§

impl FromLeStream for i32

Source§

fn from_le_stream<T>(bytes: T) -> Option<Self>
where T: Iterator<Item = u8>,

Source§

impl FromLeStream for i64

Source§

fn from_le_stream<T>(bytes: T) -> Option<Self>
where T: Iterator<Item = u8>,

Source§

impl FromLeStream for i128

Source§

fn from_le_stream<T>(bytes: T) -> Option<Self>
where T: Iterator<Item = u8>,

Source§

impl FromLeStream for isize

Source§

fn from_le_stream<T>(bytes: T) -> Option<Self>
where T: Iterator<Item = u8>,

Source§

impl FromLeStream for u8

Source§

fn from_le_stream<T>(bytes: T) -> Option<Self>
where T: Iterator<Item = Self>,

Source§

impl FromLeStream for u16

Source§

fn from_le_stream<T>(bytes: T) -> Option<Self>
where T: Iterator<Item = u8>,

Source§

impl FromLeStream for u32

Source§

fn from_le_stream<T>(bytes: T) -> Option<Self>
where T: Iterator<Item = u8>,

Source§

impl FromLeStream for u64

Source§

fn from_le_stream<T>(bytes: T) -> Option<Self>
where T: Iterator<Item = u8>,

Source§

impl FromLeStream for u128

Source§

fn from_le_stream<T>(bytes: T) -> Option<Self>
where T: Iterator<Item = u8>,

Source§

impl FromLeStream for ()

Source§

fn from_le_stream<T>(_: T) -> Option<Self>
where T: Iterator<Item = u8>,

This is guaranteed to always return Some(()).

Source§

impl FromLeStream for usize

Source§

fn from_le_stream<T>(bytes: T) -> Option<Self>
where T: Iterator<Item = u8>,

Source§

impl<T> FromLeStream for Option<T>
where T: FromLeStream,

Source§

fn from_le_stream<I>(bytes: I) -> Option<Self>
where I: Iterator<Item = u8>,

This is guaranteed to always return Some(Option<T>).

Source§

impl<T> FromLeStream for Box<[T]>
where T: FromLeStream,

Source§

fn from_le_stream<I>(bytes: I) -> Option<Self>
where I: Iterator<Item = u8>,

Source§

impl<T> FromLeStream for Vec<T>
where T: FromLeStream,

Source§

fn from_le_stream<I>(bytes: I) -> Option<Self>
where I: Iterator<Item = u8>,

Source§

impl<T> FromLeStream for PhantomData<T>

Source§

fn from_le_stream<I>(_: I) -> Option<Self>
where I: Iterator<Item = u8>,

This is guaranteed to always return Some(PhantomData<T>).

Source§

impl<T> FromLeStream for Range<T>
where T: FromLeStream,

Source§

fn from_le_stream<I>(bytes: I) -> Option<Self>
where I: Iterator<Item = u8>,

Source§

impl<T> FromLeStream for RangeInclusive<T>
where T: FromLeStream,

Source§

fn from_le_stream<I>(bytes: I) -> Option<Self>
where I: Iterator<Item = u8>,

Source§

impl<T, const SIZE: usize> FromLeStream for [T; SIZE]
where T: FromLeStream,

Source§

fn from_le_stream<I>(bytes: I) -> Option<Self>
where I: Iterator<Item = u8>,

Implementors§