ReadZipperOwned

Struct ReadZipperOwned 

Source
pub struct ReadZipperOwned<V: Clone + Send + Sync + 'static, A: Allocator + 'static = GlobalAlloc> { /* private fields */ }
Expand description

A Zipper that holds ownership of the root node, so there is no need for a lifetime parameter

Implementations§

Source§

impl<V: 'static + Clone + Send + Sync + Unpin, A: Allocator> ReadZipperOwned<V, A>

Source

pub fn into_map(self) -> PathMap<V, A>

Consumes the zipper and returns a map contained within the zipper

Trait Implementations§

Source§

impl<V: 'static + Clone + Send + Sync + Unpin, A: Allocator> Clone for ReadZipperOwned<V, A>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<V: Clone + Send + Sync + Unpin, A: Allocator> Debug for ReadZipperOwned<V, A>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<V: Clone + Send + Sync + Unpin, A: Allocator> Zipper for ReadZipperOwned<V, A>

Source§

fn path_exists(&self) -> bool

Returns true if the zipper’s focus is on a path within the trie, otherwise false
Source§

fn is_val(&self) -> bool

Returns true if there is a value at the zipper’s focus, otherwise false
Source§

fn child_count(&self) -> usize

Returns the number of child branches from the focus node Read more
Source§

fn child_mask(&self) -> ByteMask

Returns 256-bit mask indicating which children exist from the branch at the zipper’s focus Read more
Source§

fn is_value(&self) -> bool

👎Deprecated
Deprecated alias for Zipper::is_val
Source§

impl<V: Clone + Send + Sync + Unpin, A: Allocator> ZipperAbsolutePath for ReadZipperOwned<V, A>

Source§

fn origin_path(&self) -> &[u8]

Returns the entire path from the zipper’s origin to its current focus Read more
Source§

fn root_prefix_path(&self) -> &[u8]

Returns the path from the zipper’s origin to the zipper’s root Read more
Source§

impl<V: Clone + Send + Sync + Unpin, A: Allocator> ZipperConcrete for ReadZipperOwned<V, A>

Source§

fn shared_node_id(&self) -> Option<u64>

Get an identifier unique to the node at the zipper’s focus, if the zipper’s focus is at the root of a node in memory. When zipper’s focus is inside of a node, returns None. Read more
Source§

fn is_shared(&self) -> bool

Returns true if the zipper’s focus is at a location that may be accessed via two or more distinct paths Read more
Source§

impl<V: Clone + Send + Sync + Unpin, A: Allocator> ZipperForking<V> for ReadZipperOwned<V, A>

Source§

type ReadZipperT<'a> = ReadZipperUntracked<'a, 'a, V, A> where Self: 'a

The read-zipper type returned from fork_read_zipper
Source§

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<V: Clone + Send + Sync + Unpin, A: Allocator> ZipperIteration for ReadZipperOwned<V, A>

Source§

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

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 more
Source§

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 more
Source§

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<V: Clone + Send + Sync + Unpin, A: Allocator> ZipperMoving for ReadZipperOwned<V, A>

Source§

fn at_root(&self) -> bool

Returns true if the zipper’s focus is at its root, and it cannot ascend further, otherwise returns false
Source§

fn reset(&mut self)

Resets the zipper’s focus back to its root
Source§

fn path(&self) -> &[u8]

Returns the path from the zipper’s root to the current focus
Source§

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)

Moves the zipper deeper into the trie, to the key specified relative to the current zipper focus
Source§

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 location
Source§

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 more
Source§

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 more
Source§

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_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 more
Source§

fn descend_indexed_byte(&mut self, child_idx: usize) -> bool

Descends the zipper’s focus one byte into a child branch uniquely identified by child_idx Read more
Source§

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

Descends the zipper’s focus until a branch or a value is encountered. Returns true if the focus moved otherwise returns false Read more
Source§

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

Moves the zipper’s focus to the previous sibling byte with the same parent Read more
Source§

fn ascend(&mut self, steps: usize) -> bool

Ascends the zipper steps steps. Returns true if the zipper sucessfully moved steps Read more
Source§

fn ascend_byte(&mut self) -> bool

Ascends the zipper up a single byte. Equivalent to passing 1 to ascend
Source§

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 more
Source§

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 more
Source§

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§

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 more
Source§

fn descend_to_value<K: AsRef<[u8]>>(&mut self, k: K) -> usize

👎Deprecated
Deprecated alias for ZipperMoving::descend_to_val
Source§

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

Descends the zipper’s focus one step into the last child branch Read more
Source§

impl<V: Clone + Send + Sync + Unpin, A: Allocator> ZipperPathBuffer for ReadZipperOwned<V, A>

Source§

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 more
Source§

fn prepare_buffers(&mut self)

Make sure the path buffer is allocated, to facilitate zipper movement
Source§

fn reserve_buffers(&mut self, path_len: usize, stack_depth: usize)

Reserve buffer space within the zipper’s path buffer and node stack Read more
Source§

impl<'trie, V: Clone + Send + Sync + Unpin + 'trie, A: Allocator + 'trie> ZipperReadOnlyConditionalIteration<'trie, V> for ReadZipperOwned<V, A>

Source§

fn to_next_get_val_with_witness<'w>( &mut self, witness: &'w Self::WitnessT, ) -> Option<&'w V>
where 'a: 'w,

Source§

impl<'trie, V: Clone + Send + Sync + Unpin + 'trie, A: Allocator + 'trie> ZipperReadOnlyConditionalValues<'trie, V> for ReadZipperOwned<V, A>

Source§

type WitnessT = ReadZipperWitness<V, A>

The type that acts as a witness for the validity of the zipper
Source§

fn witness<'w>(&self) -> ReadZipperWitness<V, A>

Creates a witness that can allow acquisition of longer-lived borrows of values, while the zipper itself is mutated
Source§

fn get_val_with_witness<'w>( &self, witness: &'w ReadZipperWitness<V, A>, ) -> Option<&'w V>
where 'trie: 'w,

Returns a refernce to the value at the zipper’s focus, or None if there is no value Read more
Source§

impl<'a, V: Clone + Send + Sync + Unpin, A: Allocator> ZipperReadOnlySubtries<'a, V, A> for ReadZipperOwned<V, A>
where Self: 'a,

Source§

type TrieRefT = TrieRefOwned<V, A>

The type of the returned TrieRef
Source§

fn trie_ref_at_path<K: AsRef<[u8]>>(&self, path: K) -> TrieRefOwned<V, A>

Returns a TrieRef for the specified path, relative to the current focus
Source§

impl<V: Clone + Send + Sync + Unpin, A: Allocator> ZipperSubtries<V, A> for ReadZipperOwned<V, A>

Source§

fn make_map(&self) -> Option<PathMap<Self::V, A>>

Returns a new PathMap containing everything below the zipper’s focus or None if no subtrie exists below the focus Read more
Source§

impl<V: Clone + Send + Sync + Unpin, A: Allocator> ZipperValues<V> for ReadZipperOwned<V, A>

Source§

fn val(&self) -> Option<&V>

Returns a refernce to the value at the zipper’s focus, or None if there is no value Read more
Source§

fn value(&self) -> Option<&V>

👎Deprecated
Deprecated alias for ZipperValues::val

Auto Trait Implementations§

§

impl<V, A> Freeze for ReadZipperOwned<V, A>

§

impl<V, A = ()> !RefUnwindSafe for ReadZipperOwned<V, A>

§

impl<V, A> Send for ReadZipperOwned<V, A>

§

impl<V, A> Sync for ReadZipperOwned<V, A>

§

impl<V, A> Unpin for ReadZipperOwned<V, A>

§

impl<V, A> UnwindSafe for ReadZipperOwned<V, A>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<'a, Z, V> Catamorphism<V> for Z

Source§

fn into_cata_side_effect_fallible<W, Err, AlgF>( self, alg_f: AlgF, ) -> Result<W, Err>
where AlgF: FnMut(&ByteMask, &mut [W], Option<&V>, &[u8]) -> Result<W, Err>,

Allows the closure to return an error, stopping traversal immediately Read more
Source§

fn into_cata_jumping_side_effect_fallible<W, Err, AlgF>( self, alg_f: AlgF, ) -> Result<W, Err>
where AlgF: FnMut(&ByteMask, &mut [W], usize, Option<&V>, &[u8]) -> Result<W, Err>,

Allows the closure to return an error, stopping traversal immediately Read more
Source§

fn into_cata_cached_fallible<W, E, AlgF>(self, alg_f: AlgF) -> Result<W, E>
where W: Clone, AlgF: Fn(&ByteMask, &mut [W], Option<&V>) -> Result<W, E>,

Allows the closure to return an error, stopping traversal immediately Read more
Source§

fn into_cata_jumping_cached_fallible<W, E, AlgF>( self, alg_f: AlgF, ) -> Result<W, E>
where W: Clone, AlgF: Fn(&ByteMask, &mut [W], Option<&V>, &[u8]) -> Result<W, E>,

Allows the closure to return an error, stopping traversal immediately Read more
Source§

fn into_cata_side_effect<W, AlgF>(self, alg_f: AlgF) -> W
where AlgF: FnMut(&ByteMask, &mut [W], Option<&V>, &[u8]) -> W, Self: Sized,

Applies a “stepping” catamorphism to the trie descending from the zipper’s root, running the alg_f at every step (at every byte) Read more
Source§

fn into_cata_jumping_side_effect<W, AlgF>(self, alg_f: AlgF) -> W
where AlgF: FnMut(&ByteMask, &mut [W], usize, Option<&V>, &[u8]) -> W, Self: Sized,

Applies a “jumping” catamorphism to the trie Read more
Source§

fn into_cata_cached<W, AlgF>(self, alg_f: AlgF) -> W
where W: Clone, AlgF: Fn(&ByteMask, &mut [W], Option<&V>) -> W, Self: Sized,

Applies a cached, stepping, catamorphism to the trie descending from the zipper’s root, running the alg_f at every step (at every byte) Read more
Source§

fn into_cata_jumping_cached<W, AlgF>(self, alg_f: AlgF) -> W
where W: Clone, AlgF: Fn(&ByteMask, &mut [W], Option<&V>, &[u8]) -> W, Self: Sized,

Applies a “jumping” catamorphism to the trie Read more
Source§

impl<'a, Z, V> CatamorphismDebug<V> for Z

Source§

fn into_cata_jumping_cached_fallible_debug<W, E, AlgF>( self, alg_f: AlgF, ) -> Result<W, E>
where W: Clone, AlgF: Fn(&ByteMask, &mut [W], Option<&V>, &[u8], &[u8]) -> Result<W, E>,

A version of into_cata_jumping_cached where the full path is available to the closure; For debugging purposes only Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> TrieValue for T
where T: Clone + Send + Sync + Unpin + 'static,