pub struct HistoryTreeNode {
    pub label: NodeLabel,
    pub last_epoch: u64,
    pub birth_epoch: u64,
    pub parent: NodeLabel,
    pub node_type: NodeType,
}
Expand description

A HistoryNode represents a generic interior node of a compressed history tree. The main idea here is that the tree is changing at every epoch and that we do not need to replicate the state of a node, unless it changes. However, in order to allow for a user to monitor the state of a key-value pair in the past, the older states also need to be stored. While the states themselves can be stored elsewhere, we need a list of epochs when this node was updated, and that is what this data structure is meant to do.

Fields

label: NodeLabel

The binary label for this node

last_epoch: u64

The last epoch this node was updated in

birth_epoch: u64

The epoch that this node was birthed in

parent: NodeLabel

The label of this node’s parent

node_type: NodeType

The type of node: leaf root or interior.

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

Deserialize this value from the given Serde deserializer. Read more

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

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

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.

Performs the conversion.

Performs the conversion.

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

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.