pub struct BlockProof {
pub index: usize,
pub path: Vec<(DocumentId, bool)>,
pub root_hash: DocumentId,
pub algorithm: HashAlgorithm,
}Expand description
A Merkle proof for a specific block.
This proof allows verification that a block is part of a document without revealing the entire document content.
Fields§
§index: usizeIndex of the block in the document.
path: Vec<(DocumentId, bool)>Path from leaf to root: (sibling_hash, is_right_sibling).
root_hash: DocumentIdExpected root hash.
algorithm: HashAlgorithmHash algorithm used.
Implementations§
Source§impl BlockProof
impl BlockProof
Sourcepub fn verify(&self, block_hash: &DocumentId) -> bool
pub fn verify(&self, block_hash: &DocumentId) -> bool
Sourcepub fn verify_detailed(&self, block_hash: &DocumentId) -> ProofVerification
pub fn verify_detailed(&self, block_hash: &DocumentId) -> ProofVerification
Create a verification result with details.
Trait Implementations§
Source§impl Clone for BlockProof
impl Clone for BlockProof
Source§fn clone(&self) -> BlockProof
fn clone(&self) -> BlockProof
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 Debug for BlockProof
impl Debug for BlockProof
Source§impl<'de> Deserialize<'de> for BlockProof
impl<'de> Deserialize<'de> for BlockProof
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 BlockProof
impl PartialEq for BlockProof
Source§impl Serialize for BlockProof
impl Serialize for BlockProof
impl Eq for BlockProof
impl StructuralPartialEq for BlockProof
Auto Trait Implementations§
impl Freeze for BlockProof
impl RefUnwindSafe for BlockProof
impl Send for BlockProof
impl Sync for BlockProof
impl Unpin for BlockProof
impl UnsafeUnpin for BlockProof
impl UnwindSafe for BlockProof
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.