[−][src]Enum exonum_merkledb::ListProof
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 the left child contains requested elements.
Right(Hash, Box<ListProof<V>>)
A branch of proof in which only the right child contains requested elements.
Leaf(V)
A leaf of the proof with the requested element.
Absent(ProofOfAbsence)
Proof of absence of an element with the specified index.
Methods
impl<V> ListProof<V> where
V: BinaryValue,
[src]
V: BinaryValue,
pub fn validate(
&self,
expected_list_hash: Hash,
len: u64
) -> Result<Vec<(u64, &V)>, ListProofError>
[src]
&self,
expected_list_hash: Hash,
len: u64
) -> Result<Vec<(u64, &V)>, ListProofError>
Verifies the correctness of the proof by the trusted list hash and the number of elements in the tree.
To validate the proof one needs to provide expected_list_hash
calculated as follows:
h = sha-256( HashTag::List || len as u64 || merkle_root )
and length
of the ProofListIndex
.
If the proof is valid, a vector with indices and references to elements is returned.
Otherwise, Err
is returned.
If the proof is the proof of absence, then empty vector will be returned.
Trait Implementations
impl<V: Clone> Clone for ListProof<V>
[src]
fn clone(&self) -> ListProof<V>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<V: PartialEq> PartialEq<ListProof<V>> for ListProof<V>
[src]
impl<V: Eq> Eq for ListProof<V>
[src]
impl<V: Debug> Debug for ListProof<V>
[src]
impl<V: Serialize> Serialize for ListProof<V>
[src]
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>,
Auto Trait Implementations
impl<V> Sync for ListProof<V> where
V: Sync,
V: Sync,
impl<V> Send for ListProof<V> where
V: Send,
V: Send,
impl<V> Unpin for ListProof<V> where
V: Unpin,
V: Unpin,
impl<V> RefUnwindSafe for ListProof<V> where
V: RefUnwindSafe,
V: RefUnwindSafe,
impl<V> UnwindSafe for ListProof<V> where
V: UnwindSafe,
V: UnwindSafe,
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> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,
fn vzip(self) -> V
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,