Struct collections::btree::node::NodeRef [] [src]

pub struct NodeRef<BorrowType, K, V, Type> {
    height: usize,
    node: NonZero<*const LeafNode<K, V>>,
    root: *const Root<K, V>,
    _marker: PhantomData<(BorrowType, Type)>,
}
Unstable (collections #27783)

: library is unlikely to be stabilized with the current layout and name, use std::collections instead

A reference to a node.

This type has a number of paramaters that controls how it acts: - BorrowType: This can be Immut<'a> or Mut<'a> for some 'a or Owned. When this is Immut<'a>, the NodeRef acts roughly like &'a Node, when this is Mut<'a>, the NodeRef acts roughly like &'a mut Node, and when this is Owned, the NodeRef acts roughly like Box<Node>. - K and V: These control what types of things are stored in the nodes. - Type: This can be Leaf, Internal, or LeafOrInternal. When this is Leaf, the NodeRef points to a leaf node, when this is Internal the NodeRef points to an internal node, and when this is LeafOrInternal the NodeRef could be pointing to either type of node.

Fields

height
Unstable (collections #27783)

: library is unlikely to be stabilized with the current layout and name, use std::collections instead

node
Unstable (collections #27783)

: library is unlikely to be stabilized with the current layout and name, use std::collections instead

root
Unstable (collections #27783)

: library is unlikely to be stabilized with the current layout and name, use std::collections instead

_marker
Unstable (collections #27783)

: library is unlikely to be stabilized with the current layout and name, use std::collections instead

Methods

impl<BorrowType, K, V> NodeRef<BorrowType, K, V, Internal>

fn as_internal(&self) -> &InternalNode<K, V>

Unstable (collections #27783)

: library is unlikely to be stabilized with the current layout and name, use std::collections instead

impl<'a, K, V> NodeRef<Mut<'a>, K, V, Internal>

fn as_internal_mut(&mut self) -> &mut InternalNode<K, V>

Unstable (collections #27783)

: library is unlikely to be stabilized with the current layout and name, use std::collections instead

impl<BorrowType, K, V, Type> NodeRef<BorrowType, K, V, Type>

fn len(&self) -> usize

Unstable (collections #27783)

: library is unlikely to be stabilized with the current layout and name, use std::collections instead

fn forget_type(self) -> NodeRef<BorrowType, K, V, LeafOrInternal>

Unstable (collections #27783)

: library is unlikely to be stabilized with the current layout and name, use std::collections instead

fn reborrow<'a>(&'a self) -> NodeRef<Immut<'a>, K, V, Type>

Unstable (collections #27783)

: library is unlikely to be stabilized with the current layout and name, use std::collections instead

fn as_leaf(&self) -> &LeafNode<K, V>

Unstable (collections #27783)

: library is unlikely to be stabilized with the current layout and name, use std::collections instead

fn keys(&self) -> &[K]

Unstable (collections #27783)

: library is unlikely to be stabilized with the current layout and name, use std::collections instead

fn vals(&self) -> &[V]

Unstable (collections #27783)

: library is unlikely to be stabilized with the current layout and name, use std::collections instead

fn ascend(self) -> Result<Handle<NodeRef<BorrowType, K, V, Internal>, Edge>, Self>

Unstable (collections #27783)

: library is unlikely to be stabilized with the current layout and name, use std::collections instead

fn first_edge(self) -> Handle<Self, Edge>

Unstable (collections #27783)

: library is unlikely to be stabilized with the current layout and name, use std::collections instead

fn last_edge(self) -> Handle<Self, Edge>

Unstable (collections #27783)

: library is unlikely to be stabilized with the current layout and name, use std::collections instead

impl<K, V> NodeRef<Owned, K, V, Leaf>

unsafe fn deallocate_and_ascend(self) -> Option<Handle<NodeRef<Owned, K, V, Internal>, Edge>>

Unstable (collections #27783)

: library is unlikely to be stabilized with the current layout and name, use std::collections instead

impl<K, V> NodeRef<Owned, K, V, Internal>

unsafe fn deallocate_and_ascend(self) -> Option<Handle<NodeRef<Owned, K, V, Internal>, Edge>>

Unstable (collections #27783)

: library is unlikely to be stabilized with the current layout and name, use std::collections instead

impl<'a, K, V, Type> NodeRef<Mut<'a>, K, V, Type>

unsafe fn cast_unchecked<NewType>(&mut self) -> NodeRef<Mut, K, V, NewType>

Unstable (collections #27783)

: library is unlikely to be stabilized with the current layout and name, use std::collections instead

unsafe fn reborrow_mut(&mut self) -> NodeRef<Mut, K, V, Type>

Unstable (collections #27783)

: library is unlikely to be stabilized with the current layout and name, use std::collections instead

fn as_leaf_mut(&mut self) -> &mut LeafNode<K, V>

Unstable (collections #27783)

: library is unlikely to be stabilized with the current layout and name, use std::collections instead

fn keys_mut(&mut self) -> &mut [K]

Unstable (collections #27783)

: library is unlikely to be stabilized with the current layout and name, use std::collections instead

fn vals_mut(&mut self) -> &mut [V]

Unstable (collections #27783)

: library is unlikely to be stabilized with the current layout and name, use std::collections instead

impl<'a, K: 'a, V: 'a, Type> NodeRef<Immut<'a>, K, V, Type>

fn into_slices(self) -> (&'a [K], &'a [V])

Unstable (collections #27783)

: library is unlikely to be stabilized with the current layout and name, use std::collections instead

impl<'a, K: 'a, V: 'a, Type> NodeRef<Mut<'a>, K, V, Type>

fn into_root_mut(self) -> &'a mut Root<K, V>

Unstable (collections #27783)

: library is unlikely to be stabilized with the current layout and name, use std::collections instead

fn into_slices_mut(self) -> (&'a mut [K], &'a mut [V])

Unstable (collections #27783)

: library is unlikely to be stabilized with the current layout and name, use std::collections instead

impl<'a, K, V> NodeRef<Mut<'a>, K, V, Leaf>

fn push(&mut self, key: K, val: V)

Unstable (collections #27783)

: library is unlikely to be stabilized with the current layout and name, use std::collections instead

fn push_front(&mut self, key: K, val: V)

Unstable (collections #27783)

: library is unlikely to be stabilized with the current layout and name, use std::collections instead

impl<'a, K, V> NodeRef<Mut<'a>, K, V, Internal>

fn push(&mut self, key: K, val: V, edge: Root<K, V>)

Unstable (collections #27783)

: library is unlikely to be stabilized with the current layout and name, use std::collections instead

fn push_front(&mut self, key: K, val: V, edge: Root<K, V>)

Unstable (collections #27783)

: library is unlikely to be stabilized with the current layout and name, use std::collections instead

impl<'a, K, V> NodeRef<Mut<'a>, K, V, LeafOrInternal>

fn pop(&mut self) -> (K, V, Option<Root<K, V>>)

Unstable (collections #27783)

: library is unlikely to be stabilized with the current layout and name, use std::collections instead

fn pop_front(&mut self) -> (K, V, Option<Root<K, V>>)

Unstable (collections #27783)

: library is unlikely to be stabilized with the current layout and name, use std::collections instead

impl<BorrowType, K, V> NodeRef<BorrowType, K, V, LeafOrInternal>

fn force(self) -> ForceResult<NodeRef<BorrowType, K, V, Leaf>, NodeRef<BorrowType, K, V, Internal>>

Unstable (collections #27783)

: library is unlikely to be stabilized with the current layout and name, use std::collections instead

Trait Implementations

impl<'a, K: 'a, V: 'a, Type> Copy for NodeRef<Immut<'a>, K, V, Type>

impl<'a, K: 'a, V: 'a, Type> Clone for NodeRef<Immut<'a>, K, V, Type>

fn clone(&self) -> Self

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

impl<BorrowType, K: Sync, V: Sync, Type> Sync for NodeRef<BorrowType, K, V, Type>

impl<'a, K: Sync + 'a, V: Sync + 'a, Type> Send for NodeRef<Immut<'a>, K, V, Type>

impl<'a, K: Send + 'a, V: Send + 'a, Type> Send for NodeRef<Mut<'a>, K, V, Type>

impl<K: Send, V: Send, Type> Send for NodeRef<Owned, K, V, Type>