pub trait Le: Copy + Default {
const SIZE: usize;
// Required methods
fn read_le(b: &[u8]) -> Self;
fn write_le(self, out: &mut [u8]);
}Expand description
Fixed-size little-endian value. read_le/write_le require a slice of exactly SIZE bytes.
Required Associated Constants§
Required Methods§
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 Le for bool
1 byte ([bool] elements, bool inside a struct). Spec §5.3 / §6.3: the writer writes
00 or 01; the reader reads 00 as false and any other value as true.
impl Le for bool
1 byte ([bool] elements, bool inside a struct). Spec §5.3 / §6.3: the writer writes
00 or 01; the reader reads 00 as false and any other value as true.
Not used for a bool table field: that one has no slot, only 2 bits (presence +
value, spec §4.4), written with TableW::set_bool / FixedW::set_bool and read with
TableRef::bool. This 1-byte form is only for struct fields
and [bool] elements.