pub struct EmptyZipper { /* private fields */ }Expand description
A Zipper type that moves over a completely empty trie
Implementations§
Source§impl EmptyZipper
impl EmptyZipper
Sourcepub fn new_at_path<K: AsRef<[u8]>>(path: K) -> Self
pub fn new_at_path<K: AsRef<[u8]>>(path: K) -> Self
Returns a new EmptyZipper with the provided root_prefix_path
Trait Implementations§
Source§impl Clone for EmptyZipper
impl Clone for EmptyZipper
Source§fn clone(&self) -> EmptyZipper
fn clone(&self) -> EmptyZipper
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 Debug for EmptyZipper
impl Debug for EmptyZipper
Source§impl Default for EmptyZipper
impl Default for EmptyZipper
Source§fn default() -> EmptyZipper
fn default() -> EmptyZipper
Returns the “default value” for a type. Read more
Source§impl Zipper for EmptyZipper
impl Zipper for EmptyZipper
Source§fn path_exists(&self) -> bool
fn path_exists(&self) -> bool
Returns
true if the zipper’s focus is on a path within the trie, otherwise falseSource§fn is_val(&self) -> bool
fn is_val(&self) -> bool
Returns
true if there is a value at the zipper’s focus, otherwise falseSource§fn child_count(&self) -> usize
fn child_count(&self) -> usize
Returns the number of child branches from the focus node Read more
Source§fn child_mask(&self) -> ByteMask
fn child_mask(&self) -> ByteMask
Returns 256-bit mask indicating which children exist from the branch at the zipper’s focus Read more
Source§impl ZipperAbsolutePath for EmptyZipper
impl ZipperAbsolutePath for EmptyZipper
Source§impl<V> ZipperForking<V> for EmptyZipper
impl<V> ZipperForking<V> for EmptyZipper
Source§type ReadZipperT<'a> = EmptyZipper
type ReadZipperT<'a> = EmptyZipper
The read-zipper type returned from fork_read_zipper
Source§fn fork_read_zipper<'a>(&'a self) -> Self::ReadZipperT<'a>
fn fork_read_zipper<'a>(&'a self) -> Self::ReadZipperT<'a>
Returns a new read-only Zipper, with the new zipper’s root being at the zipper’s current focus Read more
Source§impl ZipperIteration for EmptyZipper
impl ZipperIteration for EmptyZipper
Source§fn to_next_val(&mut self) -> bool
fn to_next_val(&mut self) -> bool
Systematically advances to the next value accessible from the zipper, traversing in a depth-first
order Read more
Source§fn descend_first_k_path(&mut self, _k: usize) -> bool
fn descend_first_k_path(&mut self, _k: usize) -> bool
Descends the zipper’s focus
k bytes, following the first child at each branch, and continuing
with depth-first exploration until a path that is k bytes from the focus has been found Read moreSource§fn to_next_k_path(&mut self, _k: usize) -> bool
fn to_next_k_path(&mut self, _k: usize) -> bool
Moves the zipper’s focus to the next location with the same path length as the current focus,
following a depth-first exploration from a common root
k steps above the current focus Read moreSource§fn descend_last_path(&mut self) -> bool
fn descend_last_path(&mut self) -> bool
Descends the zipper to the end of the last path (last by sort order) reachable by descent
from the current focus. Read more
Source§impl ZipperMoving for EmptyZipper
impl ZipperMoving for EmptyZipper
Source§fn at_root(&self) -> bool
fn at_root(&self) -> bool
Returns
true if the zipper’s focus is at its root, and it cannot ascend further, otherwise returns falseSource§fn val_count(&self) -> usize
fn val_count(&self) -> usize
Returns the total number of values contained at and below the zipper’s focus, including the focus itself Read more
Source§fn descend_to<K: AsRef<[u8]>>(&mut self, k: K)
fn descend_to<K: AsRef<[u8]>>(&mut self, k: K)
Moves the zipper deeper into the trie, to the
key specified relative to the current zipper focusSource§fn descend_to_byte(&mut self, k: u8)
fn descend_to_byte(&mut self, k: u8)
Moves the zipper one byte deeper into the trie. Identical in effect to descend_to
with a 1-byte key argument
Source§fn descend_indexed_byte(&mut self, _idx: usize) -> bool
fn descend_indexed_byte(&mut self, _idx: usize) -> bool
Descends the zipper’s focus one byte into a child branch uniquely identified by
child_idx Read moreSource§fn descend_first_byte(&mut self) -> bool
fn descend_first_byte(&mut self) -> bool
Descends the zipper’s focus one step into the first child branch in a depth-first traversal Read more
Source§fn descend_until(&mut self) -> bool
fn descend_until(&mut self) -> bool
Descends the zipper’s focus until a branch or a value is encountered. Returns
true if the focus
moved otherwise returns false Read moreSource§fn ascend_byte(&mut self) -> bool
fn ascend_byte(&mut self) -> bool
Ascends the zipper up a single byte. Equivalent to passing
1 to ascendSource§fn ascend_until(&mut self) -> bool
fn ascend_until(&mut self) -> bool
Ascends the zipper to the nearest upstream branch point or value. Returns
true if the zipper
focus moved upwards, otherwise returns false if the zipper was already at the root Read moreSource§fn ascend_until_branch(&mut self) -> bool
fn ascend_until_branch(&mut self) -> bool
Ascends the zipper to the nearest upstream branch point, skipping over values along the way. Returns
true if the zipper focus moved upwards, otherwise returns false if the zipper was already at the
root Read moreSource§fn to_next_sibling_byte(&mut self) -> bool
fn to_next_sibling_byte(&mut self) -> bool
Moves the zipper’s focus to the next sibling byte with the same parent Read more
Source§fn to_prev_sibling_byte(&mut self) -> bool
fn to_prev_sibling_byte(&mut self) -> bool
Moves the zipper’s focus to the previous sibling byte with the same parent Read more
Source§fn move_to_path<K: AsRef<[u8]>>(&mut self, path: K) -> usize
fn move_to_path<K: AsRef<[u8]>>(&mut self, path: K) -> usize
Moves the zipper’s focus to a specific location specified by
path, relative to the zipper’s root Read moreSource§fn descend_to_check<K: AsRef<[u8]>>(&mut self, k: K) -> bool
fn descend_to_check<K: AsRef<[u8]>>(&mut self, k: K) -> bool
Fused
descend_to and path_exists. Moves the
focus and returns whether or not the path exists at the new focus locationSource§fn descend_to_existing<K: AsRef<[u8]>>(&mut self, k: K) -> usize
fn descend_to_existing<K: AsRef<[u8]>>(&mut self, k: K) -> usize
Moves the zipper deeper into the trie, following the path specified by
k, relative to the current
zipper focus. Descent stops at the point where the path does not exist Read moreSource§fn descend_to_val<K: AsRef<[u8]>>(&mut self, k: K) -> usize
fn descend_to_val<K: AsRef<[u8]>>(&mut self, k: K) -> usize
Moves the zipper deeper into the trie, following the path specified by
k, relative to the current
zipper focus. Descent stops if a value is encountered or if the path ceases to exist. Read moreSource§fn descend_to_value<K: AsRef<[u8]>>(&mut self, k: K) -> usize
fn descend_to_value<K: AsRef<[u8]>>(&mut self, k: K) -> usize
👎Deprecated
Deprecated alias for ZipperMoving::descend_to_val
Source§fn descend_to_existing_byte(&mut self, k: u8) -> bool
fn descend_to_existing_byte(&mut self, k: u8) -> bool
Moves the zipper one byte deeper into the trie, if the specified path byte exists in the
child_mask. Read moreSource§fn descend_indexed_branch(&mut self, idx: usize) -> bool
fn descend_indexed_branch(&mut self, idx: usize) -> bool
👎Deprecated
A deprecated alias for ZipperMoving::descend_indexed_byte
Source§fn descend_last_byte(&mut self) -> bool
fn descend_last_byte(&mut self) -> bool
Descends the zipper’s focus one step into the last child branch Read more
Source§fn to_next_step(&mut self) -> bool
fn to_next_step(&mut self) -> bool
Advances the zipper to visit every existing path within the trie in a depth-first order Read more
Source§impl ZipperPathBuffer for EmptyZipper
impl ZipperPathBuffer for EmptyZipper
Source§unsafe fn origin_path_assert_len(&self, len: usize) -> &[u8] ⓘ
unsafe fn origin_path_assert_len(&self, len: usize) -> &[u8] ⓘ
Internal method to get the path, beyond its length. Panics if
len > the path’s capacity, or
if the zipper is relative and doesn’t have an origin_path Read moreSource§fn prepare_buffers(&mut self)
fn prepare_buffers(&mut self)
Make sure the path buffer is allocated, to facilitate zipper movement
Source§impl<'a, V: Clone + Send + Sync> ZipperReadOnlyConditionalIteration<'a, V> for EmptyZipper
impl<'a, V: Clone + Send + Sync> ZipperReadOnlyConditionalIteration<'a, V> for EmptyZipper
Source§impl<'a, V: Clone + Send + Sync> ZipperReadOnlyConditionalValues<'a, V> for EmptyZipper
impl<'a, V: Clone + Send + Sync> ZipperReadOnlyConditionalValues<'a, V> for EmptyZipper
Source§impl<'a, V: Clone + Send + Sync> ZipperReadOnlyIteration<'a, V> for EmptyZipper
impl<'a, V: Clone + Send + Sync> ZipperReadOnlyIteration<'a, V> for EmptyZipper
Source§fn to_next_get_val(&mut self) -> Option<&'a V>
fn to_next_get_val(&mut self) -> Option<&'a V>
Advances to the next value with behavior identical to ZipperIteration::to_next_val, but returns
a reference to the value or
None if the zipper has encountered the rootSource§fn to_next_get_value(&mut self) -> Option<&'a V>
fn to_next_get_value(&mut self) -> Option<&'a V>
👎Deprecated
Deprecated alias for ZipperReadOnlyIteration::to_next_get_val
Source§impl<'a, V: Clone + Send + Sync> ZipperReadOnlyValues<'a, V> for EmptyZipper
impl<'a, V: Clone + Send + Sync> ZipperReadOnlyValues<'a, V> for EmptyZipper
Auto Trait Implementations§
impl Freeze for EmptyZipper
impl RefUnwindSafe for EmptyZipper
impl Send for EmptyZipper
impl Sync for EmptyZipper
impl Unpin for EmptyZipper
impl UnwindSafe for EmptyZipper
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