Struct bitstring_trees::map::RadixMap
[−]
[src]
pub struct RadixMap<S: BitString, V> { /* fields omitted */ }
RadixMap is a binary tree with path-shortening; leafs mark
prefixes mapping to a value, inner nodes have no semantic meaning.
If a prefix maps to a value set, all strings prefixed by it are also considered to map to that value.
If an inner node would have only a single child, the paths to and from it could be shortened - therefor all inner nodes have two children.
Methods
impl<S: BitString + Clone, V> RadixMap<S, V>[src]
fn new() -> Self
New (empty) map.
fn insert_uncompressed(&mut self, key: S, value: V) where
V: Clone,
V: Clone,
Add a new prefix => value mapping.
As values can't be compared for equality it cannot merge neighbour prefixes that map to the same value.
fn insert(&mut self, key: S, value: V) where
V: Clone + Eq,
V: Clone + Eq,
Add a new prefix => value mapping. (Partially) overwrites old mappings.
fn root(&self) -> Option<&Node<S, V>>
Read-only access to the tree.
An empty map doesn't have any nodes (i.e. None).
fn iter(&self) -> Iter<S, V>
Iterate over all values in the map
fn iter_full(&self) -> IterFull<S, V>
Iterate over all values and missing values in the map
Trait Implementations
impl<S: Clone + BitString, V: Clone> Clone for RadixMap<S, V>[src]
fn clone(&self) -> RadixMap<S, V>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0
Performs copy-assignment from source. Read more