pub enum DbRecord {
Azks(Azks),
TreeNode(TreeNodeWithPreviousValue),
ValueState(ValueState),
}
Expand description
This needs to be PUBLIC public, since anyone implementing a data-layer will need to be able to access this and all the internal types
Variants§
Azks(Azks)
An Azks
TreeNode(TreeNodeWithPreviousValue)
A TreeNode
ValueState(ValueState)
The state of the value for a particular key.
Implementations§
source§impl DbRecord
impl DbRecord
sourcepub fn get_full_binary_id(&self) -> Vec<u8> ⓘ
pub fn get_full_binary_id(&self) -> Vec<u8> ⓘ
Compte a serialized id from the record’s fields. This id is useful to use as key in key-value stores.
sourcepub fn build_azks(latest_epoch: u64, num_nodes: u64) -> Azks
pub fn build_azks(latest_epoch: u64, num_nodes: u64) -> Azks
Build an azks instance from the properties
sourcepub fn build_tree_node_with_previous_value(
label_val: [u8; 32],
label_len: u32,
last_epoch: u64,
least_descendant_ep: u64,
parent_label_val: [u8; 32],
parent_label_len: u32,
node_type: u8,
left_child: Option<NodeLabel>,
right_child: Option<NodeLabel>,
hash: Digest,
p_last_epoch: Option<u64>,
p_least_descendant_ep: Option<u64>,
p_parent_label_val: Option<[u8; 32]>,
p_parent_label_len: Option<u32>,
p_node_type: Option<u8>,
p_left_child: Option<NodeLabel>,
p_right_child: Option<NodeLabel>,
p_hash: Option<Digest>
) -> TreeNodeWithPreviousValue
pub fn build_tree_node_with_previous_value(
label_val: [u8; 32],
label_len: u32,
last_epoch: u64,
least_descendant_ep: u64,
parent_label_val: [u8; 32],
parent_label_len: u32,
node_type: u8,
left_child: Option<NodeLabel>,
right_child: Option<NodeLabel>,
hash: Digest,
p_last_epoch: Option<u64>,
p_least_descendant_ep: Option<u64>,
p_parent_label_val: Option<[u8; 32]>,
p_parent_label_len: Option<u32>,
p_node_type: Option<u8>,
p_left_child: Option<NodeLabel>,
p_right_child: Option<NodeLabel>,
p_hash: Option<Digest>
) -> TreeNodeWithPreviousValue
Build a history tree node from the properties
Trait Implementations§
impl Eq for DbRecord
impl StructuralEq for DbRecord
impl StructuralPartialEq for DbRecord
Auto Trait Implementations§
impl RefUnwindSafe for DbRecord
impl Send for DbRecord
impl Sync for DbRecord
impl Unpin for DbRecord
impl UnwindSafe for DbRecord
Blanket Implementations§
source§impl<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,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.