pub trait ToLeStream{
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§
Sourcetype Iter
type Iter
Iterator returned by to_le_stream.
Required Methods§
Sourcefn to_le_stream(self) -> Self::Iter
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".