Trait le_stream::FromLeStream

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

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

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

Required Methods§

source

fn from_le_stream<T>(bytes: &mut 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: &mut 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.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl FromLeStream for bool

source§

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

source§

impl FromLeStream for i8

source§

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

source§

impl FromLeStream for i16

source§

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

source§

impl FromLeStream for i32

source§

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

source§

impl FromLeStream for i64

source§

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

source§

impl FromLeStream for u8

source§

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

source§

impl FromLeStream for u16

source§

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

source§

impl FromLeStream for u32

source§

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

source§

impl FromLeStream for u64

source§

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

source§

impl FromLeStream for u128

source§

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

source§

impl FromLeStream for ()

source§

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

source§

impl FromLeStream for usize

source§

fn from_le_stream<T>(bytes: &mut 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: &mut I) -> Option<Self>
where I: Iterator<Item = u8>,

source§

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

source§

fn from_le_stream<I>(bytes: &mut 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: &mut I) -> Option<Self>
where I: Iterator<Item = u8>,

Implementors§