Struct weezl::encode::Tree

source ·
struct Tree {
    simples: Vec<Simple>,
    complex: Vec<Full>,
    keys: Vec<CompressedKey>,
}
Expand description

One tree node for at most each code. To avoid using too much memory we keep nodes with few successors in optimized form. This form doesn’t offer lookup by indexing but instead does a linear search.

Fields§

§simples: Vec<Simple>§complex: Vec<Full>§keys: Vec<CompressedKey>

Implementations§

source§

impl Tree

source

fn init(&mut self, min_size: u8)

source

fn reset(&mut self, min_size: u8)

source

fn at_key(&self, code: u16, ch: u8) -> Option<u16>

source

fn iterate(&mut self, code: u16, ch: u8) -> Result<u16, u16>

Iterate to the next char. Return Ok when it was already in the tree or creates a new entry for it and returns Err.

source

fn append(&mut self, code: u16, ch: u8) -> u16

Trait Implementations§

source§

impl Default for Tree

source§

fn default() -> Tree

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Tree

§

impl RefUnwindSafe for Tree

§

impl Send for Tree

§

impl Sync for Tree

§

impl Unpin for Tree

§

impl UnwindSafe for Tree

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>,

source§

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>,

source§

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.