#[non_exhaustive]pub struct ProofNode {
pub key: PathBuf,
pub partial_len: usize,
pub value_digest: Option<ValueDigest<Value>>,
pub child_hashes: Children<Option<HashType>>,
}Expand description
A node in a proof.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.key: PathBufThe key this node is at. Each byte is a nibble.
partial_len: usizeThe length of the key prefix that is shared with the previous node.
value_digest: Option<ValueDigest<Value>>None if the node does not have a value. Otherwise, the node’s value or the hash of its value.
child_hashes: Children<Option<HashType>>The hash of each child, or None if the child does not exist.
Trait Implementations§
Source§impl Hashable for ProofNode
impl Hashable for ProofNode
Source§type LeadingPath<'a> = &'a [PathComponent]
where
Self: 'a
type LeadingPath<'a> = &'a [PathComponent] where Self: 'a
The type of the leading path.
Source§type PartialPath<'a> = &'a [PathComponent]
where
Self: 'a
type PartialPath<'a> = &'a [PathComponent] where Self: 'a
The type of the partial path.
Source§fn parent_prefix_path(&self) -> Self::LeadingPath<'_>
fn parent_prefix_path(&self) -> Self::LeadingPath<'_>
The full path of this node’s parent where each byte is a nibble.
Source§fn partial_path(&self) -> Self::PartialPath<'_>
fn partial_path(&self) -> Self::PartialPath<'_>
The partial path of this node where each byte is a nibble.
Source§fn full_path(&self) -> Self::FullPath<'_>
fn full_path(&self) -> Self::FullPath<'_>
The full path of this node including the parent’s prefix where each byte is a nibble.
Source§fn value_digest(&self) -> Option<ValueDigest<&[u8]>>
fn value_digest(&self) -> Option<ValueDigest<&[u8]>>
The node’s value or hash.
impl Eq for ProofNode
impl StructuralPartialEq for ProofNode
Auto Trait Implementations§
impl Freeze for ProofNode
impl RefUnwindSafe for ProofNode
impl Send for ProofNode
impl Sync for ProofNode
impl Unpin for ProofNode
impl UnwindSafe for ProofNode
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Preimage for Twhere
T: Hashable,
impl<T> Preimage for Twhere
T: Hashable,
§impl<T> ValueSize for T
impl<T> ValueSize for T
§fn value_size(&self) -> usize
fn value_size(&self) -> usize
The size of this value in bytes, excluding allocated data. Read more
§fn value_size_sum_iter<'item>(iterator: impl Iterator<Item = &'item T>) -> usizewhere
T: 'item,
fn value_size_sum_iter<'item>(iterator: impl Iterator<Item = &'item T>) -> usizewhere
T: 'item,
The total sum of the sizes of all values in the given iterator, in
bytes. This is default-implemented by computing [ValueSize::value_size]
on every element and summing them. For Sized types, a more potentially
efficient implementation using Iterator::count is provided. If you are
implementing this trait manually, it is unlikely to be more efficient to
provide a manual implementation here. Read more
§fn value_size_sum_exact_size_iter<'item>(
iterator: impl ExactSizeIterator<Item = &'item T>,
) -> usizewhere
T: 'item,
fn value_size_sum_exact_size_iter<'item>(
iterator: impl ExactSizeIterator<Item = &'item T>,
) -> usizewhere
T: 'item,
The total sum of the sizes of all values in the given
exact-size-iterator, in bytes. This is default-implemented by using
[ValueSize::value_size_sum_iter]. For Sized types, a usually more
efficient implementation using ExactSizeIterator::len is provided. If
you are implementing this trait manually, it is unlikely to be more
efficient to provide a manual implementation here. Read more