Trait ToBytes

Source
pub trait ToBytes {
    // Required method
    fn to_bytes(&self, buf: &mut impl WritableBuffer);
}
Expand description

Allows a type to be converted to bytes and appended to a WriteableBuffer

Required Methods§

Source

fn to_bytes(&self, buf: &mut impl WritableBuffer)

Converts a type into bytes and appends it to the buffer.

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 ToBytes for &str

Source§

fn to_bytes(&self, buf: &mut impl WritableBuffer)

Source§

impl ToBytes for bool

Source§

fn to_bytes(&self, buf: &mut impl WritableBuffer)

Source§

impl ToBytes for f32

Source§

fn to_bytes(&self, buf: &mut impl WritableBuffer)

Source§

impl ToBytes for f64

Source§

fn to_bytes(&self, buf: &mut impl WritableBuffer)

Source§

impl ToBytes for i8

Source§

fn to_bytes(&self, buf: &mut impl WritableBuffer)

Source§

impl ToBytes for i16

Source§

fn to_bytes(&self, buf: &mut impl WritableBuffer)

Source§

impl ToBytes for i32

Source§

fn to_bytes(&self, buf: &mut impl WritableBuffer)

Source§

impl ToBytes for u8

Source§

fn to_bytes(&self, buf: &mut impl WritableBuffer)

Source§

impl ToBytes for u16

Source§

fn to_bytes(&self, buf: &mut impl WritableBuffer)

Source§

impl ToBytes for u32

Source§

fn to_bytes(&self, buf: &mut impl WritableBuffer)

Source§

impl ToBytes for String

Source§

fn to_bytes(&self, buf: &mut impl WritableBuffer)

Implementors§