pub struct NodeRef<'a, K: Ord + Clone, V: Clone, const SIZE: usize>(/* private fields */);Expand description
A borrowed node of a map’s tree, for a codec that must reproduce
the tree’s sharing. Two views with the same identity are the
same node; a NodeHandle from keep pins that identity for as
long as it is held.
Implementations§
Source§impl<'a, K: Ord + Clone, V: Clone, const SIZE: usize> NodeRef<'a, K, V, SIZE>
impl<'a, K: Ord + Clone, V: Clone, const SIZE: usize> NodeRef<'a, K, V, SIZE>
Sourcepub fn identity(&self) -> usize
pub fn identity(&self) -> usize
The node’s allocation address: equal for two views of one node, distinct for two nodes that are both alive.
Sourcepub fn keep(&self) -> NodeHandle<K, V, SIZE>
pub fn keep(&self) -> NodeHandle<K, V, SIZE>
An owned reference to this node.
Sourcepub fn pairs(&self) -> impl Iterator<Item = (&'a K, &'a V)> + 'a
pub fn pairs(&self) -> impl Iterator<Item = (&'a K, &'a V)> + 'a
The node’s pairs in key order.
pub fn left(&self) -> Option<NodeRef<'a, K, V, SIZE>>
pub fn right(&self) -> Option<NodeRef<'a, K, V, SIZE>>
Auto Trait Implementations§
impl<'a, K, V, const SIZE: usize> Freeze for NodeRef<'a, K, V, SIZE>where
&'a Node<K, V, SIZE>: Freeze,
impl<'a, K, V, const SIZE: usize> RefUnwindSafe for NodeRef<'a, K, V, SIZE>where
&'a Node<K, V, SIZE>: RefUnwindSafe,
impl<'a, K, V, const SIZE: usize> Send for NodeRef<'a, K, V, SIZE>where
&'a Node<K, V, SIZE>: Send,
impl<'a, K, V, const SIZE: usize> Sync for NodeRef<'a, K, V, SIZE>where
&'a Node<K, V, SIZE>: Sync,
impl<'a, K, V, const SIZE: usize> Unpin for NodeRef<'a, K, V, SIZE>where
&'a Node<K, V, SIZE>: Unpin,
impl<'a, K, V, const SIZE: usize> UnsafeUnpin for NodeRef<'a, K, V, SIZE>where
&'a Node<K, V, SIZE>: UnsafeUnpin,
impl<'a, K, V, const SIZE: usize> UnwindSafe for NodeRef<'a, K, V, SIZE>where
&'a Node<K, V, SIZE>: 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