Struct akd::tree_node::TreeNodeWithPreviousValue
source · 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§
source§impl Clone for TreeNodeWithPreviousValue
impl Clone for TreeNodeWithPreviousValue
source§fn clone(&self) -> TreeNodeWithPreviousValue
fn clone(&self) -> TreeNodeWithPreviousValue
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for TreeNodeWithPreviousValue
impl Debug for TreeNodeWithPreviousValue
source§impl Hash for TreeNodeWithPreviousValue
impl Hash for TreeNodeWithPreviousValue
source§impl Ord for TreeNodeWithPreviousValue
impl Ord for TreeNodeWithPreviousValue
source§fn cmp(&self, other: &TreeNodeWithPreviousValue) -> Ordering
fn cmp(&self, other: &TreeNodeWithPreviousValue) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
source§impl PartialEq for TreeNodeWithPreviousValue
impl PartialEq for TreeNodeWithPreviousValue
source§fn eq(&self, other: &TreeNodeWithPreviousValue) -> bool
fn eq(&self, other: &TreeNodeWithPreviousValue) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for TreeNodeWithPreviousValue
impl PartialOrd for TreeNodeWithPreviousValue
source§fn partial_cmp(&self, other: &TreeNodeWithPreviousValue) -> Option<Ordering>
fn partial_cmp(&self, other: &TreeNodeWithPreviousValue) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more