pub struct NibTrie<T, PTR: TrieIndex = u32, LEN: TrieIndex = u16> { /* private fields */ }Implementations§
Source§impl<T, PTR: TrieIndex, LEN: TrieIndex> NibTrie<T, PTR, LEN>
impl<T, PTR: TrieIndex, LEN: TrieIndex> NibTrie<T, PTR, LEN>
pub fn new() -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn get_index(&self, key: &[u8]) -> Option<usize>
pub fn get(&self, key: &[u8]) -> Option<&T>
pub fn get_mut(&mut self, key: &[u8]) -> Option<&mut T>
Sourcepub unsafe fn get_unchecked(&self, key: &[u8]) -> Option<&T>
pub unsafe fn get_unchecked(&self, key: &[u8]) -> Option<&T>
Unchecked value lookup — assumes the key is present in the trie.
§Safety
The key must have been inserted into this trie.
pub fn iter(&self) -> Cursor<'_, T, PTR, LEN>
pub fn iter_last(&self) -> Cursor<'_, T, PTR, LEN>
Sourcepub fn iter_mut(&mut self) -> CursorMut<'_, T, PTR, LEN>
pub fn iter_mut(&mut self) -> CursorMut<'_, T, PTR, LEN>
Public forward mutable cursor: a lending tree-walk that hands out &mut T
borrows tied to the cursor (see CursorMut). Parked before the first
key — call next()/first() to position.
Sourcepub fn iter_mut_last(&mut self) -> CursorMut<'_, T, PTR, LEN>
pub fn iter_mut_last(&mut self) -> CursorMut<'_, T, PTR, LEN>
Public reverse mutable cursor: a lending tree-walk parked on the last
key (see CursorMut).
pub fn into_keys_values(self) -> (Vec<Vec<u8>>, Vec<T>)
pub fn near_capacity(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl<T, PTR, LEN> Freeze for NibTrie<T, PTR, LEN>
impl<T, PTR, LEN> RefUnwindSafe for NibTrie<T, PTR, LEN>
impl<T, PTR, LEN> Send for NibTrie<T, PTR, LEN>
impl<T, PTR, LEN> Sync for NibTrie<T, PTR, LEN>
impl<T, PTR, LEN> Unpin for NibTrie<T, PTR, LEN>
impl<T, PTR, LEN> UnsafeUnpin for NibTrie<T, PTR, LEN>
impl<T, PTR, LEN> UnwindSafe for NibTrie<T, PTR, LEN>
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