pub struct InclusionProof<D: SupportedDigest, V: VisitBytes> { /* private fields */ }Expand description
A proof that a leaf is present for a root
Implementations§
Source§impl<D, V> InclusionProof<D, V>where
D: SupportedDigest,
V: VisitBytes,
impl<D, V> InclusionProof<D, V>where
D: SupportedDigest,
V: VisitBytes,
Sourcepub fn log_length(&self) -> usize
pub fn log_length(&self) -> usize
Get the length of the log this proof shows the leaf was included in
Sourcepub fn walk(&self) -> Result<InclusionProofWalk, InclusionProofError>
pub fn walk(&self) -> Result<InclusionProofWalk, InclusionProofError>
Collects all of the node indices that must be visited in order to validate the inlcusion proof into.
Sourcepub fn evaluate_value(
&self,
hashes: &impl LogData<D, V>,
value: &V,
) -> Result<Hash<D>, InclusionProofError>
pub fn evaluate_value( &self, hashes: &impl LogData<D, V>, value: &V, ) -> Result<Hash<D>, InclusionProofError>
Evaluate an inclusion proof. Callers should verify that the returned root matches their expectation.
Walks the inclusion proof, hashes each layer, returns the root hash.
Sourcepub fn evaluate_hash(
&self,
hashes: &impl LogData<D, V>,
hash: Hash<D>,
) -> Result<Hash<D>, InclusionProofError>
pub fn evaluate_hash( &self, hashes: &impl LogData<D, V>, hash: Hash<D>, ) -> Result<Hash<D>, InclusionProofError>
Evaluate an inclusion proof. Callers should verify that the returned root matches their expectation.
Walks the inclusion proof, hashes each layer, returns the root hash.
Trait Implementations§
Source§impl<D: Clone + SupportedDigest, V: Clone + VisitBytes> Clone for InclusionProof<D, V>
impl<D: Clone + SupportedDigest, V: Clone + VisitBytes> Clone for InclusionProof<D, V>
Source§fn clone(&self) -> InclusionProof<D, V>
fn clone(&self) -> InclusionProof<D, V>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<D: Debug + SupportedDigest, V: Debug + VisitBytes> Debug for InclusionProof<D, V>
impl<D: Debug + SupportedDigest, V: Debug + VisitBytes> Debug for InclusionProof<D, V>
Source§impl<D: PartialEq + SupportedDigest, V: PartialEq + VisitBytes> PartialEq for InclusionProof<D, V>
impl<D: PartialEq + SupportedDigest, V: PartialEq + VisitBytes> PartialEq for InclusionProof<D, V>
impl<D: SupportedDigest, V: VisitBytes> StructuralPartialEq for InclusionProof<D, V>
Auto Trait Implementations§
impl<D, V> Freeze for InclusionProof<D, V>
impl<D, V> RefUnwindSafe for InclusionProof<D, V>where
D: RefUnwindSafe,
V: RefUnwindSafe,
impl<D, V> Send for InclusionProof<D, V>
impl<D, V> Sync for InclusionProof<D, V>
impl<D, V> Unpin for InclusionProof<D, V>
impl<D, V> UnwindSafe for InclusionProof<D, V>where
D: UnwindSafe,
V: UnwindSafe,
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