#[non_exhaustive]pub struct TreeNode<const N: usize> {
pub references: u64,
pub node: NodeVariant<TreeBranch<N>, TreeLeaf<N>, TreeData, N>,
}Expand description
A node in the tree.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.references: u64The number of references to this node.
node: NodeVariant<TreeBranch<N>, TreeLeaf<N>, TreeData, N>The NodeVariant of the node.
Trait Implementations§
Source§impl<const N: usize> Database<N, TreeNode<N>> for HashDB<N>
impl<const N: usize> Database<N, TreeNode<N>> for HashDB<N>
Source§type EntryType = ([u8; N], Vec<u8>)
type EntryType = ([u8; N], Vec<u8>)
The type of entry for insertion. Primarily for convenience and tracking what goes into the database.
Source§fn get_node(&self, key: Array<N>) -> Result<Option<TreeNode<N>>, Exception>
fn get_node(&self, key: Array<N>) -> Result<Option<TreeNode<N>>, Exception>
Gets a value from the database based on the given key. Read more
Source§fn insert(&mut self, key: Array<N>, value: TreeNode<N>) -> Result<(), Exception>
fn insert(&mut self, key: Array<N>, value: TreeNode<N>) -> Result<(), Exception>
Queues a key and its associated value for insertion to the database. Read more
Source§impl<const N: usize> Node<N> for TreeNode<N>
impl<const N: usize> Node<N> for TreeNode<N>
Source§type Branch = TreeBranch<N>
type Branch = TreeBranch<N>
The type of
Branch for the NodeSource§fn new(
node_variant: NodeVariant<TreeBranch<N>, TreeLeaf<N>, TreeData, N>,
) -> Self
fn new( node_variant: NodeVariant<TreeBranch<N>, TreeLeaf<N>, TreeData, N>, ) -> Self
Creates a new
Node.Source§fn get_references(&self) -> u64
fn get_references(&self) -> u64
Gets the number of references to this node.
Source§fn get_variant(self) -> NodeVariant<TreeBranch<N>, TreeLeaf<N>, TreeData, N>
fn get_variant(self) -> NodeVariant<TreeBranch<N>, TreeLeaf<N>, TreeData, N>
Decomposes the struct into its inner type.
Source§fn set_references(&mut self, references: u64)
fn set_references(&mut self, references: u64)
Sets the number of references to this node.
Source§fn set_branch(&mut self, branch: TreeBranch<N>)
fn set_branch(&mut self, branch: TreeBranch<N>)
Sets the node to contain a
Branch node. Mutually exclusive with set_data and set_leaf.impl<const N: usize> Eq for TreeNode<N>
impl<const N: usize> StructuralPartialEq for TreeNode<N>
Auto Trait Implementations§
impl<const N: usize> Freeze for TreeNode<N>
impl<const N: usize> RefUnwindSafe for TreeNode<N>
impl<const N: usize> Send for TreeNode<N>
impl<const N: usize> Sync for TreeNode<N>
impl<const N: usize> Unpin for TreeNode<N>
impl<const N: usize> UnwindSafe for TreeNode<N>
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