Trait Primitive
trait Primitive
A trait intended for simple fixed-length primitives (such as ints and floats) which allows them to be read and written to streams of different endiannesses verbatim.
Associated Types
type Bytes: TraitBound { trait_: Path { path: "AsRef", id: Id(536), args: Some(AngleBracketed { args: [Type(Slice(Primitive("u8")))], constraints: [] }) }, generic_params: [], modifier: None } + TraitBound { trait_: Path { path: "AsMut", id: Id(537), args: Some(AngleBracketed { args: [Type(Slice(Primitive("u8")))], constraints: [] }) }, generic_params: [], modifier: None }The raw byte representation of this numeric type
Required Methods
fn buffer() -> <Self as >::BytesAn empty buffer of this type's size
fn to_be_bytes(self: Self) -> <Self as >::BytesOur value in big-endian bytes
fn to_le_bytes(self: Self) -> <Self as >::BytesOur value in little-endian bytes
fn from_be_bytes(bytes: <Self as >::Bytes) -> SelfConvert big-endian bytes to our value
fn from_le_bytes(bytes: <Self as >::Bytes) -> SelfConvert little-endian bytes to our value
Implementors
impl Primitive for u32impl Primitive for f32impl Primitive for i16impl Primitive for i128impl Primitive for u16impl Primitive for u128impl Primitive for i8impl Primitive for i64impl Primitive for u8impl Primitive for u64impl<N: usize> Primitive for [u8; N]impl Primitive for i32impl Primitive for f64