[][src]Trait packed_struct::types::IntegerAsBytes

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; }

Convert a native platform integer type into a byte array.

Associated Types

type AsBytes

The byte array type, for instance [u8; 2].

Loading content...

Required methods

fn to_msb_bytes(&self) -> Self::AsBytes

Convert into a MSB byte array.

fn to_lsb_bytes(&self) -> Self::AsBytes

Convert into a LSB byte array.

fn from_msb_bytes(bytes: &Self::AsBytes) -> Self

Convert from a MSB byte array.

fn from_lsb_bytes(bytes: &Self::AsBytes) -> Self

Convert from a LSB byte array.

Loading content...

Implementations on Foreign Types

impl IntegerAsBytes for u8[src]

type AsBytes = [u8; 1]

impl IntegerAsBytes for i8[src]

type AsBytes = [u8; 1]

impl IntegerAsBytes for u16[src]

type AsBytes = [u8; 2]

impl IntegerAsBytes for i16[src]

type AsBytes = [u8; 2]

impl IntegerAsBytes for u32[src]

type AsBytes = [u8; 4]

impl IntegerAsBytes for i32[src]

type AsBytes = [u8; 4]

impl IntegerAsBytes for u64[src]

type AsBytes = [u8; 8]

impl IntegerAsBytes for i64[src]

type AsBytes = [u8; 8]

Loading content...

Implementors

Loading content...