Trait weezl::encode::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.

Object Safety§

This trait is not object safe.

Implementors§