Skip to main content

ToLeStream

Trait ToLeStream 

Source
pub trait ToLeStream
where Self::Iter: Iterator<Item = u8>,
{ type Iter; // Required method fn to_le_stream(self) -> Self::Iter; }
Expand description

Converts a value into a stream of little-endian bytes.

The returned iterator yields the complete byte representation of self. Primitive numeric implementations use their standard little-endian byte order; compound implementations concatenate the byte stream of each field or element in declaration order.

Required Associated Types§

Source

type Iter

Iterator returned by to_le_stream.

Required Methods§

Source

fn to_le_stream(self) -> Self::Iter

Returns an iterator over the little-endian byte representation.

§Examples
use le_stream::ToLeStream;

assert_eq!(0x1234_u16.to_le_stream().collect::<Vec<_>>(), [0x34, 0x12]);

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl ToLeStream for ()

Source§

type Iter = Empty<u8>

Source§

fn to_le_stream(self) -> Self::Iter

Source§

impl ToLeStream for bool

Source§

type Iter = <u8 as ToLeStream>::Iter

Source§

fn to_le_stream(self) -> Self::Iter

Source§

impl ToLeStream for f32

Source§

type Iter = IntoIter<u8, 4>

Source§

fn to_le_stream(self) -> Self::Iter

Source§

impl ToLeStream for f64

Source§

type Iter = IntoIter<u8, 8>

Source§

fn to_le_stream(self) -> Self::Iter

Source§

impl ToLeStream for i8

Source§

type Iter = IntoIter<u8, { Self::BITS as usize / 8 }>

Source§

fn to_le_stream(self) -> Self::Iter

Source§

impl ToLeStream for i16

Source§

type Iter = IntoIter<u8, { Self::BITS as usize / 8 }>

Source§

fn to_le_stream(self) -> Self::Iter

Source§

impl ToLeStream for i32

Source§

type Iter = IntoIter<u8, { Self::BITS as usize / 8 }>

Source§

fn to_le_stream(self) -> Self::Iter

Source§

impl ToLeStream for i64

Source§

type Iter = IntoIter<u8, { Self::BITS as usize / 8 }>

Source§

fn to_le_stream(self) -> Self::Iter

Source§

impl ToLeStream for i128

Source§

type Iter = IntoIter<u8, { Self::BITS as usize / 8 }>

Source§

fn to_le_stream(self) -> Self::Iter

Source§

impl ToLeStream for isize

Source§

type Iter = IntoIter<u8, { Self::BITS as usize / 8 }>

Source§

fn to_le_stream(self) -> Self::Iter

Source§

impl ToLeStream for u8

Source§

type Iter = IntoIter<u8, { Self::BITS as usize / 8 }>

Source§

fn to_le_stream(self) -> Self::Iter

Source§

impl ToLeStream for u16

Source§

type Iter = IntoIter<u8, { Self::BITS as usize / 8 }>

Source§

fn to_le_stream(self) -> Self::Iter

Source§

impl ToLeStream for u32

Source§

type Iter = IntoIter<u8, { Self::BITS as usize / 8 }>

Source§

fn to_le_stream(self) -> Self::Iter

Source§

impl ToLeStream for u64

Source§

type Iter = IntoIter<u8, { Self::BITS as usize / 8 }>

Source§

fn to_le_stream(self) -> Self::Iter

Source§

impl ToLeStream for u128

Source§

type Iter = IntoIter<u8, { Self::BITS as usize / 8 }>

Source§

fn to_le_stream(self) -> Self::Iter

Source§

impl ToLeStream for usize

Source§

type Iter = IntoIter<u8, { Self::BITS as usize / 8 }>

Source§

fn to_le_stream(self) -> Self::Iter

Source§

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

Source§

type Iter = FlatMap<IntoIter<T, SIZE>, <T as ToLeStream>::Iter, fn(T) -> <T as ToLeStream>::Iter>

Source§

fn to_le_stream(self) -> Self::Iter

Source§

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

Source§

impl<T> ToLeStream for PhantomData<T>

Source§

type Iter = Empty<u8>

Source§

fn to_le_stream(self) -> Self::Iter

Source§

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

Source§

type Iter = Chain<<T as ToLeStream>::Iter, <T as ToLeStream>::Iter>

Source§

fn to_le_stream(self) -> Self::Iter

Source§

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

Source§

type Iter = Chain<<T as ToLeStream>::Iter, <T as ToLeStream>::Iter>

Source§

fn to_le_stream(self) -> Self::Iter

Implementors§