pub struct NodeStoreVec<K: Key, V, A: Argument<K> = ()> { /* private fields */ }
Implementations§
Source§impl<K: Key, V, A: Argument<K>> NodeStoreVec<K, V, A>
impl<K: Key, V, A: Argument<K>> NodeStoreVec<K, V, A>
Sourcepub fn with_capacity(cap: usize) -> Self
pub fn with_capacity(cap: usize) -> Self
Create a new NodeStoreVec
with capacity
Trait Implementations§
Source§impl<K: Key, V, A: Argument<K>> NodeStore for NodeStoreVec<K, V, A>
impl<K: Key, V, A: Argument<K>> NodeStore for NodeStoreVec<K, V, A>
Source§fn new_empty_leaf(&mut self) -> (LeafNodeId, &mut LeafNode<K, V>)
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
fn add_inner(&mut self, node: Box<InnerNode<K, A>>) -> InnerNodeId
Add the inner node to the store and returns its id
Source§fn try_get_inner(&self, id: InnerNodeId) -> Option<&InnerNode<K, A>>
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>
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>>
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>>)
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
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>
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>>
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>
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 assign_leaf(&mut self, id: LeafNodeId, leaf: Box<LeafNode<K, V>>)
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>
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)
fn cache_leaf(&self, leaf_id: LeafNodeId)
cache leaf
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>
impl<K, V, A> Sync for NodeStoreVec<K, V, A>
impl<K, V, A> Unpin for NodeStoreVec<K, V, A>
impl<K, V, A> UnwindSafe for NodeStoreVec<K, V, A>
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