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
sourceimpl Clone for TreeNodeWithPreviousValue
impl Clone for TreeNodeWithPreviousValue
sourcefn clone(&self) -> TreeNodeWithPreviousValue
fn clone(&self) -> TreeNodeWithPreviousValue
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresourceimpl Debug for TreeNodeWithPreviousValue
impl Debug for TreeNodeWithPreviousValue
sourceimpl Hash for TreeNodeWithPreviousValue
impl Hash for TreeNodeWithPreviousValue
sourceimpl PartialEq<TreeNodeWithPreviousValue> for TreeNodeWithPreviousValue
impl PartialEq<TreeNodeWithPreviousValue> for TreeNodeWithPreviousValue
sourcefn eq(&self, other: &TreeNodeWithPreviousValue) -> bool
fn eq(&self, other: &TreeNodeWithPreviousValue) -> bool
sourceimpl Storable for TreeNodeWithPreviousValue
impl Storable for TreeNodeWithPreviousValue
type StorageKey = NodeKey
type StorageKey = NodeKey
sourcefn data_type() -> StorageType
fn data_type() -> StorageType
sourcefn get_id(&self) -> NodeKey
fn get_id(&self) -> NodeKey
sourcefn get_full_binary_key_id(key: &NodeKey) -> Vec<u8>
fn get_full_binary_key_id(key: &NodeKey) -> Vec<u8>
sourcefn key_from_full_binary(bin: &[u8]) -> Result<NodeKey, String>
fn key_from_full_binary(bin: &[u8]) -> Result<NodeKey, String>
sourcefn get_full_binary_id(&self) -> Vec<u8>
fn get_full_binary_id(&self) -> Vec<u8>
impl Eq for TreeNodeWithPreviousValue
impl StructuralEq for TreeNodeWithPreviousValue
impl StructuralPartialEq for TreeNodeWithPreviousValue
Auto Trait Implementations
impl RefUnwindSafe for TreeNodeWithPreviousValue
impl Send for TreeNodeWithPreviousValue
impl Sync for TreeNodeWithPreviousValue
impl Unpin for TreeNodeWithPreviousValue
impl UnwindSafe for TreeNodeWithPreviousValue
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.