Expand description
An structure optimized for verify merkle proof
Tuple Fields
0: Vec<u8>
Implementations
sourceimpl CompiledMerkleProof
impl CompiledMerkleProof
sourcepub fn extract_proof<H: Hasher + Default>(
&self,
all_leaves: Vec<(H256, H256, bool)>
) -> Result<CompiledMerkleProof>
pub fn extract_proof<H: Hasher + Default>(
&self,
all_leaves: Vec<(H256, H256, bool)>
) -> Result<CompiledMerkleProof>
Extract sub compiled proof for certain sub leaves from current compiled proof.
The argument must include all leaves. The 3rd item of every tuple indicate if the sub key is selected.
pub fn compute_root<H: Hasher + Default>(
&self,
leaves: Vec<(H256, H256)>
) -> Result<H256>
pub fn verify<H: Hasher + Default>(
&self,
root: &H256,
leaves: Vec<(H256, H256)>
) -> Result<bool>
Trait Implementations
sourceimpl Clone for CompiledMerkleProof
impl Clone for CompiledMerkleProof
sourcefn clone(&self) -> CompiledMerkleProof
fn clone(&self) -> CompiledMerkleProof
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for CompiledMerkleProof
impl Debug for CompiledMerkleProof
sourceimpl From<CompiledMerkleProof> for Vec<u8>
impl From<CompiledMerkleProof> for Vec<u8>
sourcefn from(proof: CompiledMerkleProof) -> Vec<u8>
fn from(proof: CompiledMerkleProof) -> Vec<u8>
Converts to this type from the input type.
Auto Trait Implementations
impl RefUnwindSafe for CompiledMerkleProof
impl Send for CompiledMerkleProof
impl Sync for CompiledMerkleProof
impl Unpin for CompiledMerkleProof
impl UnwindSafe for CompiledMerkleProof
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more