Struct diem_jellyfish_merkle::node_type::NodeKey
source · pub struct NodeKey { /* private fields */ }
Expand description
The unique key of each node.
Implementations§
source§impl NodeKey
impl NodeKey
sourcepub fn new_empty_path(version: Version) -> Self
pub fn new_empty_path(version: Version) -> Self
A shortcut to generate a node key consisting of a version and an empty nibble path.
sourcepub fn nibble_path(&self) -> &NibblePath
pub fn nibble_path(&self) -> &NibblePath
Gets the nibble path.
sourcepub fn gen_child_node_key(&self, version: Version, n: Nibble) -> Self
pub fn gen_child_node_key(&self, version: Version, n: Nibble) -> Self
Generates a child node key based on this node key.
sourcepub fn gen_parent_node_key(&self) -> Self
pub fn gen_parent_node_key(&self) -> Self
Generates parent node key at the same version based on this node key.
sourcepub fn set_version(&mut self, version: Version)
pub fn set_version(&mut self, version: Version)
Sets the version to the given version.
Trait Implementations§
source§impl Arbitrary for NodeKey
impl Arbitrary for NodeKey
§type Parameters = (<u64 as Arbitrary>::Parameters, <NibblePath as Arbitrary>::Parameters)
type Parameters = (<u64 as Arbitrary>::Parameters, <NibblePath as Arbitrary>::Parameters)
The type of parameters that
arbitrary_with
accepts for configuration
of the generated Strategy
. Parameters must implement Default
.§type Strategy = Map<(<u64 as Arbitrary>::Strategy, <NibblePath as Arbitrary>::Strategy), fn(_: (u64, NibblePath)) -> NodeKey>
type Strategy = Map<(<u64 as Arbitrary>::Strategy, <NibblePath as Arbitrary>::Strategy), fn(_: (u64, NibblePath)) -> NodeKey>
The type of
Strategy
used to generate values of type Self
.source§fn arbitrary_with(_top: Self::Parameters) -> Self::Strategy
fn arbitrary_with(_top: Self::Parameters) -> Self::Strategy
source§impl Ord for NodeKey
impl Ord for NodeKey
source§impl PartialEq<NodeKey> for NodeKey
impl PartialEq<NodeKey> for NodeKey
source§impl PartialOrd<NodeKey> for NodeKey
impl PartialOrd<NodeKey> for NodeKey
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for NodeKey
impl StructuralEq for NodeKey
impl StructuralPartialEq for NodeKey
Auto Trait Implementations§
impl RefUnwindSafe for NodeKey
impl Send for NodeKey
impl Sync for NodeKey
impl Unpin for NodeKey
impl UnwindSafe for NodeKey
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.