Trait endiannezz::Primitive[][src]

pub trait Primitive: Sized + Copy {
    type Buf: AsRef<[u8]> + AsMut<[u8]> + Default;
    fn to_ne_bytes(self) -> Self::Buf;
fn to_le_bytes(self) -> Self::Buf;
fn to_be_bytes(self) -> Self::Buf;
fn from_ne_bytes(bytes: Self::Buf) -> Self;
fn from_le_bytes(bytes: Self::Buf) -> Self;
fn from_be_bytes(bytes: Self::Buf) -> Self; }
Expand description

This trait is implemented for all primitive types that exist in rust, and allows to read types from bytes or write them into bytes

Associated Types

Required methods

Implementations on Foreign Types

Implementors