[−][src]Struct proof::Proof
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]
&mut self,
path: Vec<Path>,
bytes: Vec<u8>
) -> Result<(), Error>
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(&self) -> 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,
T: Send,
impl<T> Unpin for Proof<T> where
T: Unpin,
T: Unpin,
impl<T> Sync for Proof<T> where
T: Sync,
T: Sync,
impl<T> UnwindSafe for Proof<T> where
T: UnwindSafe,
T: UnwindSafe,
impl<T> RefUnwindSafe for Proof<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self