Skip to main content

WriteByteExt

Trait WriteByteExt 

Source
pub trait WriteByteExt: Write {
    // Provided methods
    fn write_u8(&mut self, b: u8) -> Result<()> { ... }
    fn write_u8_escaped(&mut self, b: u8) -> Result<usize> { ... }
}
Expand description

Additional methods for std::io::Write trait to write a single byte.

Provided Methods§

Source

fn write_u8(&mut self, b: u8) -> Result<()>

Writes a single byte to the writer.

Source

fn write_u8_escaped(&mut self, b: u8) -> Result<usize>

Writes MARK_BYTE and [b] if [b] equals to either MARK_BYTE or SYNC_BYTE, otherwise only [b] is written.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<W: Write + ?Sized> WriteByteExt for W