Enum exonum::storage::ListProof
[−]
[src]
pub enum ListProof<V> { Full(Box<ListProof<V>>, Box<ListProof<V>>), Left(Box<ListProof<V>>, Option<Hash>), Right(Hash, Box<ListProof<V>>), Leaf(V), }
An enum that represents a proof of existence for a proof list elements.
Variants
Full(Box<ListProof<V>>, Box<ListProof<V>>)
A branch of proof in which both children contain requested elements.
Left(Box<ListProof<V>>, Option<Hash>)
A branch of proof in which only left child contains requested elements.
Right(Hash, Box<ListProof<V>>)
A branch of proof in which only right child contains requested elements.
Leaf(V)
A leaf of proof with requested element.
Methods
impl<V: StorageValue> ListProof<V>
[src]
fn validate(
&self,
root_hash: Hash,
len: u64
) -> Result<Vec<(u64, &V)>, ListProofError>
[src]
&self,
root_hash: Hash,
len: u64
) -> Result<Vec<(u64, &V)>, ListProofError>
Verifies the correctness of the proof by the trusted root hash and the number of elements in the tree.
If the proof is valid, a vector with indices and references to elements is returned.
Otherwise, Err
is returned.
Trait Implementations
impl<V: Debug> Debug for ListProof<V>
[src]
impl<V: PartialEq> PartialEq for ListProof<V>
[src]
fn eq(&self, __arg_0: &ListProof<V>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &ListProof<V>) -> bool
[src]
This method tests for !=
.
impl<V: Eq> Eq for ListProof<V>
[src]
impl<V: Serialize> Serialize for ListProof<V>
[src]
fn serialize<S>(&self, ser: S) -> Result<S::Ok, S::Error> where
S: Serializer,
[src]
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<'a, V> Deserialize<'a> for ListProof<V> where
V: Deserialize<'de>,
[src]
V: Deserialize<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'a>,
[src]
D: Deserializer<'a>,
Deserialize this value from the given Serde deserializer. Read more