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

Creates a new HistoryNodeState

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This particular storage will have a key type

Must return a valid storage type

Retrieve an instance of the id of this storable. The combination of the storable’s StorageType and this id are globally unique Read more

Retrieve the full binary version of a key (for comparisons)

Reformat a key from the full-binary specification

Retrieve the full binary version of a key (for comparisons)

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Compare self to key and return true if they are equal.

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.