pub struct AdaptiveRadixTree<V> { /* private fields */ }Expand description
An adaptive radix tree for string-keyed data.
Implementations§
Source§impl<V: Clone> AdaptiveRadixTree<V>
impl<V: Clone> AdaptiveRadixTree<V>
Sourcepub fn insert(&mut self, key: &str, value: V) -> Option<V>
pub fn insert(&mut self, key: &str, value: V) -> Option<V>
Insert a key-value pair. Returns the previous value if the key existed.
Sourcepub fn prefix_scan(&self, prefix: &str) -> Vec<(&str, &V)>
pub fn prefix_scan(&self, prefix: &str) -> Vec<(&str, &V)>
Return all key-value pairs whose keys start with the given prefix, sorted by key.
Sourcepub fn delete(&mut self, key: &str) -> Option<V>
pub fn delete(&mut self, key: &str) -> Option<V>
Delete a key. Returns the value if it existed.
Sourcepub fn node_distribution(&self) -> NodeDistribution
pub fn node_distribution(&self) -> NodeDistribution
Get node type distribution for diagnostics.
Trait Implementations§
Source§impl<V: Clone> Clone for AdaptiveRadixTree<V>
impl<V: Clone> Clone for AdaptiveRadixTree<V>
Source§fn clone(&self) -> AdaptiveRadixTree<V>
fn clone(&self) -> AdaptiveRadixTree<V>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<V: Debug> Debug for AdaptiveRadixTree<V>
impl<V: Debug> Debug for AdaptiveRadixTree<V>
Auto Trait Implementations§
impl<V> Freeze for AdaptiveRadixTree<V>
impl<V> RefUnwindSafe for AdaptiveRadixTree<V>where
V: RefUnwindSafe,
impl<V> Send for AdaptiveRadixTree<V>where
V: Send,
impl<V> Sync for AdaptiveRadixTree<V>where
V: Sync,
impl<V> Unpin for AdaptiveRadixTree<V>
impl<V> UnsafeUnpin for AdaptiveRadixTree<V>
impl<V> UnwindSafe for AdaptiveRadixTree<V>where
V: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more