[][src]Struct ranagrams::trie::Trie

pub struct Trie {
    pub root: TrieNode,
    pub translator: Translator,
    pub cache: RwLock<HashMap<Arc<CharCount>, Arc<Vec<(Arc<Vec<usize>>, Arc<CharCount>)>>>>,
    pub use_cache: bool,
    pub shuffle: bool,
    // some fields omitted
}

The magical boundary between words and numbers, a Trie wraps a TrieNode and various things used for stringification, destringification, and various caches and denormalizations.

Fields

root: TrieNodetranslator: Translatorcache: RwLock<HashMap<Arc<CharCount>, Arc<Vec<(Arc<Vec<usize>>, Arc<CharCount>)>>>>use_cache: boolshuffle: bool

Implementations

impl Trie[src]

pub fn new(
    root: TrieNode,
    translator: Translator,
    use_cache: bool,
    shuffle: bool
) -> Trie
[src]

pub fn remove(&mut self, word: &[usize])[src]

Removes the given word from the trie

pub fn words_for(
    &self,
    cc: Arc<CharCount>,
    sort_key: &[usize],
    all_words: &bool
) -> Vec<(Arc<Vec<usize>>, Arc<CharCount>)>
[src]

Produces the words, in their numeric representation, extractable from a CharCount along with the residual CharCounts remaining after their extraction. More precisely, it is those words sorting at or above the order of the given sort key. The sort key ensures that only one permutation of a given anagram is produced.

pub fn optimize(self, cc: CharCount) -> Trie[src]

pub fn stringify(&self, todo: ToDo) -> String[src]

Convert a ToDo from a linked list of words in numeric representation to a single String representing an anagram.

Trait Implementations

impl Clone for Trie[src]

Auto Trait Implementations

impl RefUnwindSafe for Trie

impl Send for Trie

impl Sync for Trie

impl Unpin for Trie

impl UnwindSafe for Trie

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,