trie_alg::trie::charset

Trait CharSet

Source
pub trait CharSet {
    const SIZE: usize;

    // Required methods
    fn map(ch: char) -> usize;
    fn unmap(hash: usize) -> char;
}
Expand description

Implement this trait to space optimize your trie according to your character set

Required Associated Constants§

Source

const SIZE: usize

number of characters in the CharSet

Required Methods§

Source

fn map(ch: char) -> usize

provide one to one mapping from char to usize

Source

fn unmap(hash: usize) -> char

provide one to one mapping from usize to char

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§

Source§

impl CharSet for Ascii

Source§

const SIZE: usize = 256usize

Source§

impl CharSet for LowerCase

Source§

const SIZE: usize = 26usize

Source§

impl CharSet for UpperCase

Source§

const SIZE: usize = 26usize