Struct akd::node_state::HistoryNodeState
source · [−]pub struct HistoryNodeState {
pub value: [u8; 32],
pub child_states: [Option<HistoryChildState>; 2],
pub key: NodeStateKey,
}
Expand description
A HistoryNodeState represents the state of a crate::history_tree_node::HistoryTreeNode at a given epoch. As you may see, when looking at HistoryChildState, the node needs to include its hashed value, the hashed values of its children and the labels of its children. This allows the various algorithms in crate::history_tree_node::HistoryTreeNode to build proofs for the tree at any given epoch, without having to do a traversal of the history tree to find siblings. The hash value of this node at this state. To be used in its parent, alongwith the label.
Fields
value: [u8; 32]
The hash at this node state
child_states: [Option<HistoryChildState>; 2]
The states of the children at this time
key: NodeStateKey
A unique key
Implementations
sourceimpl HistoryNodeState
impl HistoryNodeState
sourcepub fn new<H: Hasher>(key: NodeStateKey) -> Self
pub fn new<H: Hasher>(key: NodeStateKey) -> Self
Creates a new HistoryNodeState
Trait Implementations
sourceimpl Clone for HistoryNodeState
impl Clone for HistoryNodeState
sourceimpl Debug for HistoryNodeState
impl Debug for HistoryNodeState
sourceimpl Display for HistoryNodeState
impl Display for HistoryNodeState
sourceimpl PartialEq<HistoryNodeState> for HistoryNodeState
impl PartialEq<HistoryNodeState> for HistoryNodeState
sourcefn eq(&self, other: &HistoryNodeState) -> bool
fn eq(&self, other: &HistoryNodeState) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &HistoryNodeState) -> bool
fn ne(&self, other: &HistoryNodeState) -> bool
This method tests for !=
.
sourceimpl Storable for HistoryNodeState
impl Storable for HistoryNodeState
type Key = NodeStateKey
type Key = NodeStateKey
This particular storage will have a key type
sourcefn data_type() -> StorageType
fn data_type() -> StorageType
Must return a valid storage type
sourcefn get_id(&self) -> NodeStateKey
fn get_id(&self) -> NodeStateKey
Retrieve an instance of the id of this storable. The combination of the storable’s StorageType and this id are globally unique Read more
sourcefn get_full_binary_key_id(key: &NodeStateKey) -> Vec<u8>
fn get_full_binary_key_id(key: &NodeStateKey) -> Vec<u8>
Retrieve the full binary version of a key (for comparisons)
sourcefn key_from_full_binary(bin: &[u8]) -> Result<NodeStateKey, String>
fn key_from_full_binary(bin: &[u8]) -> Result<NodeStateKey, String>
Reformat a key from the full-binary specification
sourcefn get_full_binary_id(&self) -> Vec<u8>
fn get_full_binary_id(&self) -> Vec<u8>
Retrieve the full binary version of a key (for comparisons)
impl Eq for HistoryNodeState
impl StructuralEq for HistoryNodeState
impl StructuralPartialEq for HistoryNodeState
impl Sync for HistoryNodeState
Auto Trait Implementations
impl RefUnwindSafe for HistoryNodeState
impl Send for HistoryNodeState
impl Unpin for HistoryNodeState
impl UnwindSafe for HistoryNodeState
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more