weezl::encode

Trait Buffer

Source
trait Buffer {
    // Required methods
    fn new(size: u8) -> Self;
    fn reset(&mut self, min_size: u8);
    fn clear(&mut self, min_size: u8);
    fn buffer_code(&mut self, code: u16);
    fn push_out(&mut self, out: &mut &mut [u8]) -> bool;
    fn flush_out(&mut self, out: &mut &mut [u8]) -> bool;
    fn buffer_pad(&mut self);
    fn bump_code_size(&mut self);
    fn max_code(&self) -> u16;
    fn code_size(&self) -> u8;
}

Required Methods§

Source

fn new(size: u8) -> Self

Source

fn reset(&mut self, min_size: u8)

Reset the code size in the buffer.

Source

fn clear(&mut self, min_size: u8)

Apply effects of a Clear Code.

Source

fn buffer_code(&mut self, code: u16)

Insert a code into the buffer.

Source

fn push_out(&mut self, out: &mut &mut [u8]) -> bool

Push bytes if the buffer space is getting small.

Source

fn flush_out(&mut self, out: &mut &mut [u8]) -> bool

Flush all full bytes, returning if at least one more byte remains.

Source

fn buffer_pad(&mut self)

Pad the buffer to a full byte.

Source

fn bump_code_size(&mut self)

Increase the maximum code size.

Source

fn max_code(&self) -> u16

Return the maximum code with the current code size.

Source

fn code_size(&self) -> u8

Return the current code size in bits.

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§