pub struct Trie<K, V> { /* private fields */ }
Implementations§
source§impl<K, V> Trie<K, V>where
K: Hash + Eq,
impl<K, V> Trie<K, V>where
K: Hash + Eq,
pub fn insert<Q, I: IntoIterator<Item = K>>(&mut self, prefix: I, value: V)where
K: Borrow<Q>,
Q: Hash + Eq + ?Sized,
pub fn insert_alt<Q, I: IntoIterator<Item = K>>(&mut self, prefix: I, value: V)where
K: Borrow<Q>,
Q: Hash + Eq + ?Sized,
pub fn is_empty(&self) -> bool
pub fn get_ref<Q, I: IntoIterator<Item = K>>(
&self,
prefix: I
) -> Option<&Trie<K, V>>where
K: Borrow<Q>,
Q: Hash + Eq + ?Sized,
pub fn get_mut<Q, I: IntoIterator<Item = K>>(
&mut self,
prefix: I
) -> Option<&mut Trie<K, V>>where
K: Borrow<Q>,
Q: Hash + Eq + ?Sized,
pub fn remove<Q, I: IntoIterator<Item = K>>(&mut self, prefix: I) -> Option<V>where
K: Borrow<Q>,
Q: Hash + Eq + ?Sized,
pub fn values_vec<'a, Q>(&'a self) -> Vec<&'a V>where
K: Borrow<Q>,
Q: Hash + Eq + ?Sized,
pub fn values<'a, B, Q>(&'a self) -> Bwhere
B: FromIterator<&'a V>,
K: Borrow<Q>,
Q: Hash + Eq + ?Sized,
pub fn values_prefix<'a, I, Q>(&'a self, prefix: I) -> Vec<&'a V>where
I: IntoIterator<Item = K>,
V: Debug,
K: Borrow<Q> + Debug,
Q: Hash + Eq + ?Sized,
pub fn iter<'a>(&'a self) -> Iter<'a, K, V> ⓘ
source§impl<V> Trie<char, V>
impl<V> Trie<char, V>
pub fn insert_str<S: AsRef<str>>(&mut self, prefix: S, value: V)
pub fn get_ref_str<Q, S: AsRef<str>>(&self, prefix: S) -> Option<&Trie<char, V>>where
Q: Hash + Eq + ?Sized,
pub fn get_mut_str<Q, S: AsRef<str>>(
&mut self,
prefix: S
) -> Option<&mut Trie<char, V>>where
Q: Hash + Eq + ?Sized,
pub fn remove_str<Q, S: AsRef<str>>(&mut self, prefix: S) -> Option<V>where
Q: Hash + Eq + ?Sized,
source§impl<V> Trie<u8, V>
impl<V> Trie<u8, V>
pub fn insert_bytes<S>(&mut self, prefix: S, value: V)where
S: AsRef<[u8]>,
pub fn get_ref_str<Q, S: AsRef<[u8]>>(&self, prefix: S) -> Option<&Self>where
Q: Hash + Eq + ?Sized,
pub fn get_mut_str<Q, S: AsRef<[u8]>>(&mut self, prefix: S) -> Option<&mut Self>where
Q: Hash + Eq + ?Sized,
pub fn remove_str<Q, S: AsRef<[u8]>>(&mut self, prefix: S) -> Option<V>where
Q: Hash + Eq + ?Sized,
Trait Implementations§
source§impl<'a, K, V, P> Extend<(P, V)> for Trie<K, V>where
P: IntoIterator<Item = K>,
K: Eq + Hash,
impl<'a, K, V, P> Extend<(P, V)> for Trie<K, V>where
P: IntoIterator<Item = K>,
K: Eq + Hash,
source§fn extend<I: IntoIterator<Item = (P, V)>>(&mut self, iter: I)
fn extend<I: IntoIterator<Item = (P, V)>>(&mut self, iter: I)
Extends a collection with the contents of an iterator. Read more
source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more