Trait crockford::Write

source ·
pub trait Write {
    // Required method
    unsafe fn write(&mut self, u: u8);
}
Expand description

Represents writable buffer capable of receiving encoded data.

Write is implemented on Vec<u8> and String, but you are free to implement it on your own types. One conceivable purpose would be to allow for lowercase encoding output by inverting the cap bit before writing.

For performance reasons, the default implementation of each of these does not

Required Methods§

source

unsafe fn write(&mut self, u: u8)

Writes a single byte (or, more precisely, a 5-bit group) to the output.

Safety

Provided implementations of this function do not check whether a given u8 byte is valid ascii before trying to add each byte to the output string.

Implementations on Foreign Types§

source§

impl Write for String

source§

unsafe fn write(&mut self, u: u8)

source§

impl Write for Vec<u8>

source§

unsafe fn write(&mut self, u: u8)

Implementors§