pub struct Trie<K, V> { /* private fields */ }
Implementations§
Source§impl<K: Ord + Clone, V: Clone> Trie<K, V>
impl<K: Ord + Clone, V: Clone> Trie<K, V>
pub fn exact_match<Key: AsRef<[K]>>(&self, query: Key) -> bool
pub fn get<Key: AsRef<[K]>>(&self, query: Key) -> Option<&V>
pub fn get_mut<Key: AsRef<[K]>>(&mut self, query: Key) -> Option<&mut V>
pub fn set<Key: AsRef<[K]>>(&mut self, query: Key, value: V)
Sourcepub fn predictive_search<Arr: AsRef<[K]>>(&self, query: Arr) -> Vec<Vec<K>>
pub fn predictive_search<Arr: AsRef<[K]>>(&self, query: Arr) -> Vec<Vec<K>>
§Panics
If query
is empty.
pub fn common_prefix_search<Key: AsRef<[K]>>(&self, query: Key) -> Vec<Vec<K>>
pub fn common_prefix_search_with_values<Key: AsRef<[K]>>( &self, query: Key, ) -> Vec<(Vec<K>, V)>
Auto Trait Implementations§
impl<K, V> Freeze for Trie<K, V>
impl<K, V> RefUnwindSafe for Trie<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for Trie<K, V>
impl<K, V> Sync for Trie<K, V>
impl<K, V> Unpin for Trie<K, V>
impl<K, V> UnwindSafe for Trie<K, V>where
K: UnwindSafe,
V: 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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more