Trait packed_struct::types::IntegerAsBytes [−][src]
pub trait IntegerAsBytes where
Self: Sized, {
type AsBytes;
fn to_msb_bytes(&self) -> Self::AsBytes;
fn to_lsb_bytes(&self) -> Self::AsBytes;
fn from_msb_bytes(bytes: &Self::AsBytes) -> Self;
fn from_lsb_bytes(bytes: &Self::AsBytes) -> Self;
}
Expand description
Convert a native platform integer type into a byte array.
Associated Types
Required methods
fn to_msb_bytes(&self) -> Self::AsBytes
fn to_msb_bytes(&self) -> Self::AsBytes
Convert into a MSB byte array.
fn to_lsb_bytes(&self) -> Self::AsBytes
fn to_lsb_bytes(&self) -> Self::AsBytes
Convert into a LSB byte array.
fn from_msb_bytes(bytes: &Self::AsBytes) -> Self
fn from_msb_bytes(bytes: &Self::AsBytes) -> Self
Convert from a MSB byte array.
fn from_lsb_bytes(bytes: &Self::AsBytes) -> Self
fn from_lsb_bytes(bytes: &Self::AsBytes) -> Self
Convert from a LSB byte array.