omnom

Trait WriteExt

Source
pub trait WriteExt: Write + Sized {
    // Provided methods
    fn write_be<B: WriteBytes>(&mut self, num: B) -> Result<usize> { ... }
    fn write_le<B: WriteBytes>(&mut self, num: B) -> Result<usize> { ... }
    fn write_ne<B: WriteBytes>(&mut self, num: B) -> Result<usize> { ... }
}
Expand description

Extension trait to Write to write bytes using endianness.

Provided Methods§

Source

fn write_be<B: WriteBytes>(&mut self, num: B) -> Result<usize>

Write bytes as big endian.

Returns the amount of bytes written.

Source

fn write_le<B: WriteBytes>(&mut self, num: B) -> Result<usize>

Write bytes as little endian.

Returns the amount of bytes written.

Source

fn write_ne<B: WriteBytes>(&mut self, num: B) -> Result<usize>

Write bytes using native endianness.

Returns the amount of bytes 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<T: Write> WriteExt for T