Struct NodeStoreVec

Source
pub struct NodeStoreVec<K: Key, V, A: Argument<K> = ()> { /* private fields */ }

Implementations§

Source§

impl<K: Key, V, A: Argument<K>> NodeStoreVec<K, V, A>

Source

pub fn new() -> Self

Create a new NodeStoreVec

Source

pub fn with_capacity(cap: usize) -> Self

Create a new NodeStoreVec with capacity

Trait Implementations§

Source§

impl<K: Key, V: Clone> Clone for NodeStoreVec<K, V>

Source§

fn clone(&self) -> Self

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

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

Performs copy-assignment from source. Read more
Source§

impl<K: Debug + Key, V: Debug, A: Debug + Argument<K>> Debug for NodeStoreVec<K, V, A>

Source§

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

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

impl<K: Key, V, A: Argument<K>> Default for NodeStoreVec<K, V, A>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<K: Key, V, A: Argument<K>> NodeStore for NodeStoreVec<K, V, A>

Source§

type K = K

Key type for the tree
Source§

type V = V

Value type for the tree
Source§

type Argument = A

The Argument type
Source§

fn inner_n() -> u16

Get the max number of keys inner node can hold
Source§

fn leaf_n() -> u16

Get the max number of elements leaf node can hold
Source§

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

Create a new empty leaf node and returns its id
Source§

fn add_inner(&mut self, node: Box<InnerNode<K, A>>) -> InnerNodeId

Add the inner node to the store and returns its id
Source§

fn get_inner(&self, id: InnerNodeId) -> &InnerNode<K, A>

Get the inner node Read more
Source§

fn try_get_inner(&self, id: InnerNodeId) -> Option<&InnerNode<K, A>>

Get the inner node if id is invalid or the node already removed, remove None
Source§

fn get_mut_inner(&mut self, id: InnerNodeId) -> &mut InnerNode<K, A>

Get a mut reference to the InnerNode
Source§

fn take_inner(&mut self, id: InnerNodeId) -> Box<InnerNode<K, A>>

Take the inner node out of the store
Source§

fn put_back_inner(&mut self, id: InnerNodeId, node: Box<InnerNode<K, A>>)

Put back the inner node
Source§

fn reserve_leaf(&mut self) -> LeafNodeId

Reserve a leaf node, it must be assigned later
Source§

fn get_leaf(&self, id: LeafNodeId) -> &LeafNode<Self::K, Self::V>

Get a refernce to leaf node Panics if id is invalid or the node is taken
Source§

fn try_get_leaf(&self, id: LeafNodeId) -> Option<&LeafNode<K, V>>

Get a reference to leaf node Returns None if id is invalid or the node is taken
Source§

fn get_mut_leaf(&mut self, id: LeafNodeId) -> &mut LeafNode<K, V>

Get a mut reference to leaf node Panics if id is invalid or the node is taken
Source§

fn take_leaf(&mut self, id: LeafNodeId) -> Box<LeafNode<K, V>>

Take the leaf out of store
Source§

fn assign_leaf(&mut self, id: LeafNodeId, leaf: Box<LeafNode<K, V>>)

Assign the leaf to the id, the id must exists
Source§

unsafe fn get_mut_inner_ptr(&mut self, id: InnerNodeId) -> *mut InnerNode<K, A>

Get a mut pointer to inner node. User must ensure there is non shared reference to the node co-exists
Source§

fn cache_leaf(&self, leaf_id: LeafNodeId)

cache leaf
Source§

fn try_cache<Q>(&self, k: &Q) -> Option<LeafNodeId>
where Q: Ord + ?Sized, Self::K: Borrow<Q>,

try cache for k

Auto Trait Implementations§

§

impl<K, V, A = ()> !Freeze for NodeStoreVec<K, V, A>

§

impl<K, V, A> RefUnwindSafe for NodeStoreVec<K, V, A>

§

impl<K, V, A> Send for NodeStoreVec<K, V, A>
where K: Send, A: Send, V: Send,

§

impl<K, V, A> Sync for NodeStoreVec<K, V, A>
where K: Sync, A: Sync, V: Sync,

§

impl<K, V, A> Unpin for NodeStoreVec<K, V, A>

§

impl<K, V, A> UnwindSafe for NodeStoreVec<K, V, A>
where K: UnwindSafe, A: UnwindSafe, V: UnwindSafe,

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<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> 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.