Trait WriteExt

Source
pub trait WriteExt {
    // Required methods
    fn write_le<T: WriteTo>(&mut self, val: T) -> Result<()>;
    fn write_be<T: WriteTo>(&mut self, val: T) -> Result<()>;
}
Available on crate feature std only.
Expand description

Endian aware write to a Write.

Required Methods§

Source

fn write_le<T: WriteTo>(&mut self, val: T) -> Result<()>

Writes the bytes of val into self, in little endian order.

§Errors

Returns an Error if some bytes could not be written.

Source

fn write_be<T: WriteTo>(&mut self, val: T) -> Result<()>

Writes the bytes of val into self, in big endian order.

§Errors

Returns an Error if some bytes could not be written.

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.

Implementors§

Source§

impl<W: Write> WriteExt for W