CanRepr

Trait CanRepr 

Source
pub trait CanRepr: Sealed + Copy {
    type Bytes: AsRef<[u8]>;

    // Required method
    fn to_le_bytes(self) -> Self::Bytes;
}

Required Associated Types§

Required Methods§

Source

fn to_le_bytes(self) -> Self::Bytes

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 CanRepr for u8

Source§

type Bytes = [u8; 1]

Source§

fn to_le_bytes(self) -> Self::Bytes

Source§

impl CanRepr for u16

Source§

type Bytes = [u8; 2]

Source§

fn to_le_bytes(self) -> Self::Bytes

Source§

impl CanRepr for u32

Source§

type Bytes = [u8; 4]

Source§

fn to_le_bytes(self) -> Self::Bytes

Source§

impl CanRepr for u64

Source§

type Bytes = [u8; 8]

Source§

fn to_le_bytes(self) -> Self::Bytes

Implementors§