Writable

Trait Writable 

Source
pub trait Writable: DataSize {
    // Required method
    fn write_to(&self, writer: &mut impl BufMut) -> WriteResult;
}
Expand description

Allows a type to be written as bytes.

Required Methods§

Source

fn write_to(&self, writer: &mut impl BufMut) -> WriteResult

Writes self as bytes to a BufMut.

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 Writable for bool

Source§

fn write_to(&self, writer: &mut impl BufMut) -> Result<(), WriteError>

Source§

impl Writable for f32

Source§

fn write_to(&self, writer: &mut impl BufMut) -> Result<(), WriteError>

Source§

impl Writable for f64

Source§

fn write_to(&self, writer: &mut impl BufMut) -> Result<(), WriteError>

Source§

impl Writable for i8

Source§

fn write_to(&self, writer: &mut impl BufMut) -> Result<(), WriteError>

Source§

impl Writable for i16

Source§

fn write_to(&self, writer: &mut impl BufMut) -> Result<(), WriteError>

Source§

impl Writable for i32

Source§

fn write_to(&self, writer: &mut impl BufMut) -> Result<(), WriteError>

Source§

impl Writable for i64

Source§

fn write_to(&self, writer: &mut impl BufMut) -> Result<(), WriteError>

Source§

impl Writable for i128

Source§

fn write_to(&self, writer: &mut impl BufMut) -> Result<(), WriteError>

Source§

impl Writable for u8

Source§

fn write_to(&self, writer: &mut impl BufMut) -> Result<(), WriteError>

Source§

impl Writable for u16

Source§

fn write_to(&self, writer: &mut impl BufMut) -> Result<(), WriteError>

Source§

impl Writable for u32

Source§

fn write_to(&self, writer: &mut impl BufMut) -> Result<(), WriteError>

Source§

impl Writable for u64

Source§

fn write_to(&self, writer: &mut impl BufMut) -> Result<(), WriteError>

Source§

impl Writable for u128

Source§

fn write_to(&self, writer: &mut impl BufMut) -> Result<(), WriteError>

Source§

impl<T: Wrapper> Writable for Option<T>
where T::WrappedType: Zero,

Source§

fn write_to(&self, buf: &mut impl BufMut) -> WriteResult

Source§

impl<T: Writable> Writable for &[T]

Source§

fn write_to(&self, writer: &mut impl BufMut) -> WriteResult

Source§

impl<T: Writable> Writable for &T

Source§

fn write_to(&self, writer: &mut impl BufMut) -> WriteResult

Source§

impl<T: Writable> Writable for Vec<T>

Source§

fn write_to(&self, writer: &mut impl BufMut) -> WriteResult

Source§

impl<T: Writable, const N: usize> Writable for [T; N]

Source§

fn write_to(&self, writer: &mut impl BufMut) -> WriteResult

Implementors§