Trait TrieCommon

pub trait TrieCommon<'a, K, V: 'a>: ContainsTrieNode<'a, K, V>
where
    K: TrieKey + 'a,
    Self: Sized,

Common functionality available for tries and subtries.

Required Methods

fn len(self) -> usize

Number of key/value pairs stored in this trie.

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

Return an iterator over the child subtries of this node.

Provided Methods

fn key(self) -> Option<&'a K>

Get the key stored at this node, if any.

fn value(self) -> Option<&'a V>

Get the value stored at this node, if any.

fn is_empty(self) -> bool

Determine if the Trie contains 0 key-value pairs.

fn is_leaf(self) -> bool

Determine if the trie is a leaf node (has no children).

fn iter(self) -> Iter<'a, K, V>

Return an iterator over the keys and values of the Trie.

fn keys(self) -> Keys<'a, K, V>

Return an iterator over the keys of the Trie.

fn values(self) -> Values<'a, K, V>

Return an iterator over the values of the Trie.

fn prefix(self) -> &'a Nibblet

Get the prefix of this node.

Implementors