[][src]Struct qptrie::Trie

pub struct Trie<TK: PartialEq + AsRef<[u8]>, TV> { /* fields omitted */ }

A qp-trie.

Methods

impl<TK: PartialEq + AsRef<[u8]>, TV> Trie<TK, TV>[src]

pub fn new() -> Self[src]

Creates a new, empty qp-trie.

pub fn max_height(self, max_height: usize) -> Self[src]

Refuses to insert nodes that would make the trie height greater than max_height.

pub fn is_empty(&self) -> bool[src]

Returns true if the trie is empty.

pub fn insert(&mut self, key: TK, val: TV) -> bool[src]

Inserts a new node with the key key.

pub fn get(&self, key: &TK) -> Option<&TV>[src]

Returns the value associated with the key key, or None if the key is not present in the trie.

pub fn get_mut(&mut self, key: &TK) -> Option<&mut TV>[src]

Returns a mutable value associated with the key key, or None if the key is not present in the trie.

pub fn remove(&mut self, key: &TK) -> bool[src]

Removes the node associated with the key key.

Returns true if the key was found, or false if the operation was a no-op.

Important traits for TriePrefixIterator<'t, TK, TV>
pub fn prefix_iter<'t>(&'t self, prefix: &'t TK) -> TriePrefixIterator<TK, TV>[src]

Creates a new iterator over all the nodes whose key includes prefix as a prefix.

Trait Implementations

impl<TK: PartialEq + AsRef<[u8]>, TV> Default for Trie<TK, TV>[src]

impl<TK: Clone + PartialEq + AsRef<[u8]>, TV: Clone> Clone for Trie<TK, TV>[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<TK: Debug + PartialEq + AsRef<[u8]>, TV: Debug> Debug for Trie<TK, TV>[src]

Auto Trait Implementations

impl<TK, TV> Send for Trie<TK, TV> where
    TK: Send,
    TV: Send

impl<TK, TV> Sync for Trie<TK, TV> where
    TK: Sync,
    TV: Sync

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]