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.

Implementors§

Source§

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