Struct radix_trie::SubTrieMut
source · pub struct SubTrieMut<'a, K: 'a, V: 'a> { /* private fields */ }
Expand description
Mutable view of a sub-tree of a larger trie.
Implementations§
source§impl<'a, K, V> SubTrieMut<'a, K, V>where
K: TrieKey,
impl<'a, K, V> SubTrieMut<'a, K, V>where
K: TrieKey,
sourcepub fn get<Q>(&self, key: &Q) -> SubTrieResult<&V>where
K: Borrow<Q>,
Q: TrieKey + ?Sized,
pub fn get<Q>(&self, key: &Q) -> SubTrieResult<&V>where
K: Borrow<Q>,
Q: TrieKey + ?Sized,
Look up the value for the given key, which should be an extension of this subtrie’s key.
The key may be any borrowed form of the trie’s key type, but TrieKey on the borrowed form must match those for the key type
sourcepub fn insert(&mut self, key: K, value: V) -> SubTrieResult<V>
pub fn insert(&mut self, key: K, value: V) -> SubTrieResult<V>
Insert a value in this subtrie. The key should be an extension of this subtrie’s key.
sourcepub fn remove<Q>(&mut self, key: &Q) -> SubTrieResult<V>where
K: Borrow<Q>,
Q: TrieKey + ?Sized,
pub fn remove<Q>(&mut self, key: &Q) -> SubTrieResult<V>where
K: Borrow<Q>,
Q: TrieKey + ?Sized,
Remove a value from this subtrie. The key should be an extension of this subtrie’s key.
The key may be any borrowed form of the trie’s key type, but TrieKey on the borrowed form must match those for the key type