Trait WriteFixedCtx

Source
pub trait WriteFixedCtx<const N: usize, Ctx>
where Self: Sized,
{ // Required method fn to_bytes(&self, ctx: Ctx) -> [u8; N]; }
Expand description

A trait for writing data of fixed length, with context.

Required Methods§

Source

fn to_bytes(&self, ctx: Ctx) -> [u8; N]

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 WriteFixedCtx<{ ::core::mem::size_of::<$number_type>() }, &Endian> for i8

Source§

fn to_bytes(&self, ctx: &Endian) -> [u8; 1]

Source§

impl WriteFixedCtx<{ ::core::mem::size_of::<$number_type>() }, &Endian> for i16

Source§

fn to_bytes(&self, ctx: &Endian) -> [u8; 2]

Source§

impl WriteFixedCtx<{ ::core::mem::size_of::<$number_type>() }, &Endian> for i32

Source§

fn to_bytes(&self, ctx: &Endian) -> [u8; 4]

Source§

impl WriteFixedCtx<{ ::core::mem::size_of::<$number_type>() }, &Endian> for i64

Source§

fn to_bytes(&self, ctx: &Endian) -> [u8; 8]

Source§

impl WriteFixedCtx<{ ::core::mem::size_of::<$number_type>() }, &Endian> for i128

Source§

fn to_bytes(&self, ctx: &Endian) -> [u8; 16]

Source§

impl WriteFixedCtx<{ ::core::mem::size_of::<$number_type>() }, &Endian> for u8

Source§

fn to_bytes(&self, ctx: &Endian) -> [u8; 1]

Source§

impl WriteFixedCtx<{ ::core::mem::size_of::<$number_type>() }, &Endian> for u16

Source§

fn to_bytes(&self, ctx: &Endian) -> [u8; 2]

Source§

impl WriteFixedCtx<{ ::core::mem::size_of::<$number_type>() }, &Endian> for u32

Source§

fn to_bytes(&self, ctx: &Endian) -> [u8; 4]

Source§

impl WriteFixedCtx<{ ::core::mem::size_of::<$number_type>() }, &Endian> for u64

Source§

fn to_bytes(&self, ctx: &Endian) -> [u8; 8]

Source§

impl WriteFixedCtx<{ ::core::mem::size_of::<$number_type>() }, &Endian> for u128

Source§

fn to_bytes(&self, ctx: &Endian) -> [u8; 16]

Implementors§