pub struct Trie<C: Hash + Eq> { /* private fields */ }
Expand description
Prefix trie, easily augmentable by adding more fields and/or methods
Implementations§
Source§impl<C: Hash + Eq> Trie<C>
impl<C: Hash + Eq> Trie<C>
Sourcepub fn insert(&mut self, word: impl IntoIterator<Item = C>) -> usize
pub fn insert(&mut self, word: impl IntoIterator<Item = C>) -> usize
Inserts a word into the trie, and returns the index of its node.
Sourcepub fn get(&self, word: impl IntoIterator<Item = C>) -> Option<usize>
pub fn get(&self, word: impl IntoIterator<Item = C>) -> Option<usize>
Finds a word in the trie, and returns the index of its node.
Trait Implementations§
Auto Trait Implementations§
impl<C> Freeze for Trie<C>
impl<C> RefUnwindSafe for Trie<C>where
C: RefUnwindSafe,
impl<C> Send for Trie<C>where
C: Send,
impl<C> Sync for Trie<C>where
C: Sync,
impl<C> Unpin for Trie<C>where
C: Unpin,
impl<C> UnwindSafe for Trie<C>where
C: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more