[−][src]Struct tree_index::Proof
A merkle proof for an index.
Merkle trees are proven by checking the parent hashes.
Implementations
impl<'a> Proof<'a>
[src]
pub fn new(index: u64, verified_by: u64, nodes: &'a [u64]) -> Self
[src]
pub fn index(&self) -> u64
[src]
Get the index which was used to verify this node.
Examples
let nodes = vec![]; let proof = Proof::new(0, 0, &nodes); assert_eq!(proof.index(), 0);
pub fn verified_by(&self) -> u64
[src]
Get the index for the node which verifies the input index.
Examples
let nodes = vec![]; let proof = Proof::new(0, 0, &nodes); assert_eq!(proof.verified_by(), 0);
pub fn nodes(&self) -> &[u64]
[src]
Merkle proof for the index you pass, written in flat-tree
notation.
Examples
let nodes = vec![]; let proof = Proof::new(0, 0, &nodes); assert_eq!(proof.nodes().len(), 0);
Trait Implementations
impl<'a> Debug for Proof<'a>
[src]
impl<'a> PartialEq<Proof<'a>> for Proof<'a>
[src]
impl<'a> StructuralPartialEq for Proof<'a>
[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for Proof<'a>
impl<'a> Send for Proof<'a>
impl<'a> Sync for Proof<'a>
impl<'a> Unpin for Proof<'a>
impl<'a> UnwindSafe for Proof<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,