pub struct InclusionProof {
pub index: u64,
pub size: u64,
pub root: MerkleHash,
pub hashes: Vec<MerkleHash>,
}Expand description
Merkle inclusion proof for a single entry in the log.
Proves that a leaf at index is included in the tree of size leaves
with the given root.
Args:
index— Zero-based leaf index.size— Tree size (number of leaves) when the proof was generated.root— Merkle root at tree sizesize.hashes— Sibling hashes from leaf to root.
Usage:
ⓘ
let proof = InclusionProof { index: 5, size: 16, root, hashes: vec![...] };
proof.verify(&leaf_hash)?;Fields§
§index: u64§size: u64§root: MerkleHash§hashes: Vec<MerkleHash>Implementations§
Source§impl InclusionProof
impl InclusionProof
Sourcepub fn verify(&self, leaf_hash: &MerkleHash) -> Result<(), TransparencyError>
pub fn verify(&self, leaf_hash: &MerkleHash) -> Result<(), TransparencyError>
Verify that leaf_hash is included in the tree.
Trait Implementations§
Source§impl Clone for InclusionProof
impl Clone for InclusionProof
Source§fn clone(&self) -> InclusionProof
fn clone(&self) -> InclusionProof
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InclusionProof
impl Debug for InclusionProof
Source§impl<'de> Deserialize<'de> for InclusionProof
impl<'de> Deserialize<'de> for InclusionProof
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for InclusionProof
impl PartialEq for InclusionProof
Source§fn eq(&self, other: &InclusionProof) -> bool
fn eq(&self, other: &InclusionProof) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for InclusionProof
impl Serialize for InclusionProof
impl StructuralPartialEq for InclusionProof
Auto Trait Implementations§
impl Freeze for InclusionProof
impl RefUnwindSafe for InclusionProof
impl Send for InclusionProof
impl Sync for InclusionProof
impl Unpin for InclusionProof
impl UnsafeUnpin for InclusionProof
impl UnwindSafe for InclusionProof
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