Trait blockbuffers::le::LE
source · pub trait LE: Sized {
fn to_le(self) -> Self;
fn from_le(x: Self) -> Self;
fn from_le_slice(bytes: &[u8]) -> Self { ... }
}
Expand description
The trait LE
converts between native endian and little endian.
Required Methods
Provided Methods
sourcefn from_le_slice(bytes: &[u8]) -> Self
fn from_le_slice(bytes: &[u8]) -> Self
Reads from slice in little endian form.
Examples
use blockbuffers::le::LE;
assert_eq!(1u16, u16::from_le_slice(&[1u8, 0]));