[][src]Struct proof::Proof

pub struct Proof<T: MerkleTreeOverlay> { /* fields omitted */ }

A Proof is generated from a SerializedProof and can manipulate / verify data in the merkle tree.

Methods

impl<T: MerkleTreeOverlay> Proof<T>[src]

pub fn new(proof: SerializedProof) -> Self[src]

Initialize Proof directly from a SerializedProof.

pub fn load(&mut self, proof: SerializedProof) -> Result<(), Error>[src]

Populate the struct's cache with a SerializedProof.

pub fn extract(&self, path: Vec<Path>) -> Result<SerializedProof, Error>[src]

Generates a SerializedProof proving that path is a part of the current merkle tree.

pub fn get_bytes(&self, path: Vec<Path>) -> Result<Vec<u8>, Error>[src]

Returns the bytes representation of the object associated with path

pub fn set_bytes(
    &mut self,
    path: Vec<Path>,
    bytes: Vec<u8>
) -> Result<(), Error>
[src]

Replaces the bytes at path with bytes.

pub fn is_valid(&self, root: Vec<u8>) -> bool[src]

Determines if the current merkle tree is valid.

pub fn fill(&mut self) -> Result<(), Error>[src]

Inserts missing nodes into the merkle tree that can be generated from existing nodes.

pub fn root(&self) -> Option<&Vec<u8>>[src]

Returns the root node of the proof if it has been calculated.

pub fn refresh(&mut self) -> Result<(), Error>[src]

Recalculates all intermediate nodes and root using the available leaves.

Trait Implementations

impl<T: Clone + MerkleTreeOverlay> Clone for Proof<T>[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<T: Default + MerkleTreeOverlay> Default for Proof<T>[src]

impl<T: PartialEq + MerkleTreeOverlay> PartialEq<Proof<T>> for Proof<T>[src]

impl<T: Debug + MerkleTreeOverlay> Debug for Proof<T>[src]

Auto Trait Implementations

impl<T> Send for Proof<T> where
    T: Send

impl<T> Unpin for Proof<T> where
    T: Unpin

impl<T> Sync for Proof<T> where
    T: Sync

impl<T> UnwindSafe for Proof<T> where
    T: UnwindSafe

impl<T> RefUnwindSafe for Proof<T> where
    T: RefUnwindSafe

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same<T> for T[src]

type Output = T

Should always be Self