Struct SubTrieMut

pub struct SubTrieMut<'a, K: 'a, V: 'a> { /* private fields */ }

Mutable view of a sub-tree of a larger trie.

Implementations

impl<'a, K, V> SubTrieMut<'a, K, V> where K: TrieKey,

fn value_mut(&mut self) -> Option<&mut V>

Mutable reference to the node's value.

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

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.

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

Trait Implementations

impl<'a, K, V: 'a> TrieCommon<'a, K, V> for SubTrieMut<'a, K, V> where K: TrieKey + 'a,

fn len(self) -> usize

Computes from scratch.

fn children(self) -> Children<'a, K, V>

impl<'a, K: Debug + 'a, V: Debug + 'a> Debug for SubTrieMut<'a, K, V>

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Auto Trait Implementations

impl<'a, K, V> !UnwindSafe for SubTrieMut<'a, K, V>

impl<'a, K, V> Freeze for SubTrieMut<'a, K, V> where &'a mut TrieNode<K, V>: Freeze,

impl<'a, K, V> RefUnwindSafe for SubTrieMut<'a, K, V> where &'a mut TrieNode<K, V>: RefUnwindSafe,

impl<'a, K, V> Send for SubTrieMut<'a, K, V> where &'a mut TrieNode<K, V>: Send,

impl<'a, K, V> Sync for SubTrieMut<'a, K, V> where &'a mut TrieNode<K, V>: Sync,

impl<'a, K, V> Unpin for SubTrieMut<'a, K, V> where &'a mut TrieNode<K, V>: Unpin,

impl<'a, K, V> UnsafeUnpin for SubTrieMut<'a, K, V> where &'a mut TrieNode<K, V>: UnsafeUnpin,

Blanket Implementations

impl<T> Any for SubTrieMut<'a, K, V> where T: 'static + ?Sized,

impl<T> Borrow<T> for SubTrieMut<'a, K, V> where T: ?Sized,

impl<T> BorrowMut<T> for SubTrieMut<'a, K, V> where T: ?Sized,

impl<T> From<T> for SubTrieMut<'a, K, V>

impl<T, U> Into<U> for SubTrieMut<'a, K, V> where U: From<T>,

impl<T, U> TryFrom<U> for SubTrieMut<'a, K, V> where U: Into<T>,

impl<T, U> TryInto<U> for SubTrieMut<'a, K, V> where U: TryFrom<T>,