pub struct TreeNodeWithPreviousValue {
    pub label: NodeLabel,
    pub latest_node: TreeNode,
    pub previous_node: Option<TreeNode>,
}
Expand description

Represents a TreeNode with its current state and potential future state. Depending on the epoch which the Directory believes is the “most current” version, we may need to load a slightly older version of the tree node. This is because we can’t guarantee that a “publish” operation is globally atomic at the storage layer, however we do assume record-level atomicity. This means that some records may be updated to “future” values, and therefore we might need to temporarily read their previous values.

The Directory publishes the AZKS after all other records are successfully written. This single record is where the “current” epoch is determined, so any instances with read-only access (example: Directory instances service proof generation, but not publishing) will be notified that a new epoch is available, flush their caches, and retrieve data from storage directly again.

This structure holds the label along with the current value & epoch - 1

Fields

label: NodeLabel

The label of the node

latest_node: TreeNode

The “latest” node, either future or current

previous_node: Option<TreeNode>

The “previous” node, either current or past

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
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. 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.

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
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.