Trait Writeable

Source
pub trait Writeable {
    // Required method
    fn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error>;
}
Expand description

Trait that every type that can be serialized as binary must implement. Writes directly to a Writer, a utility type thinly wrapping an underlying Write implementation.

Required Methods§

Source

fn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error>

Write the data held by this Writeable to the provided writer

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 Writeable for i32

Source§

fn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error>

Source§

impl Writeable for i64

Source§

fn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error>

Source§

impl Writeable for u8

Source§

fn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error>

Source§

impl Writeable for u16

Source§

fn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error>

Source§

impl Writeable for u32

Source§

fn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error>

Source§

impl Writeable for u64

Source§

fn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error>

Source§

impl<'a, A: Writeable> Writeable for &'a A

Source§

fn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error>

Source§

impl<A: Writeable, B: Writeable> Writeable for (A, B)

Source§

fn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error>

Source§

impl<A: Writeable, B: Writeable, C: Writeable> Writeable for (A, B, C)

Source§

fn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error>

Source§

impl<A: Writeable, B: Writeable, C: Writeable, D: Writeable> Writeable for (A, B, C, D)

Source§

fn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error>

Source§

impl<T> Writeable for Vec<T>
where T: Writeable,

Source§

fn write<W: Writer>(&self, writer: &mut W) -> Result<(), Error>

Implementors§