Struct weezl::encode::EncodeState

source ·
struct EncodeState<B: Buffer> {
    min_size: u8,
    tree: Tree,
    has_ended: bool,
    is_tiff: bool,
    current_code: u16,
    clear_code: u16,
    buffer: B,
}

Fields§

§min_size: u8

The configured minimal code size.

§tree: Tree

The current encoding symbol tree.

§has_ended: bool

If we have pushed the end code.

§is_tiff: bool

If tiff then bumps are a single code sooner.

§current_code: u16

The code corresponding to the currently read characters.

§clear_code: u16

The clear code for resetting the dictionary.

§buffer: B

The bit buffer for encoding.

Implementations§

source§

impl<B: Buffer> EncodeState<B>

source

fn new(min_size: u8) -> Self

source§

impl<B: Buffer> EncodeState<B>

source

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

source

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

source

fn end_code(&self) -> u16

source

fn buffer_pad(&mut self)

source

fn buffer_code(&mut self, code: u16)

Trait Implementations§

source§

impl<B: Buffer> Stateful for EncodeState<B>

source§

fn advance(&mut self, inp: &[u8], out: &mut [u8]) -> BufferResult

source§

fn mark_ended(&mut self) -> bool

source§

fn restart(&mut self)

Reset the state tracking if end code has been written.
source§

fn reset(&mut self)

Reset the encoder to the beginning, dropping all buffers etc.

Auto Trait Implementations§

§

impl<B> Freeze for EncodeState<B>
where B: Freeze,

§

impl<B> RefUnwindSafe for EncodeState<B>
where B: RefUnwindSafe,

§

impl<B> Send for EncodeState<B>
where B: Send,

§

impl<B> Sync for EncodeState<B>
where B: Sync,

§

impl<B> Unpin for EncodeState<B>
where B: Unpin,

§

impl<B> UnwindSafe for EncodeState<B>
where B: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.