WriteExtraExt

Trait WriteExtraExt 

Source
pub trait WriteExtraExt: WriteBytesExt {
    // Required methods
    fn write_b8(&mut self, bytes: &[u8]) -> Result<()>;
    fn write_b16(&mut self, bytes: &[u8]) -> Result<()>;
    fn write_b32(&mut self, bytes: &[u8], max: usize) -> Result<()>;

    // Provided method
    fn write_str(&mut self, s: &str) -> Result<()> { ... }
}

Required Methods§

Source

fn write_b8(&mut self, bytes: &[u8]) -> Result<()>

Writes a Vec of bytes prepended with 1 byte length

Source

fn write_b16(&mut self, bytes: &[u8]) -> Result<()>

Writes a Vec of bytes prepended with 2 bytes length

Source

fn write_b32(&mut self, bytes: &[u8], max: usize) -> Result<()>

Writes a Vec of bytes prepended with 4 bytes length

Provided Methods§

Source

fn write_str(&mut self, s: &str) -> Result<()>

Writes a utf-8 string prepended by a byte with the length, in bytes, of the string

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§