Enum exonum::storage::MapProof [] [src]

pub enum MapProof<V> {
    LeafRootInclusive(DBKey, V),
    LeafRootExclusive(DBKeyHash),
    Empty,
    Branch(BranchProofNode<V>),
}

An enum that represents a proof of existence or non-existence for a proof map key.

Variants

A boundary case with a single element tree and a matching key.

A boundary case with a single element tree and a non-matching key

A boundary case with empty tree.

A root branch of the tree.

Methods

impl<V: StorageValue> MapProof<V>
[src]

[src]

Returns root hash of the map proof.

impl<V: Debug + StorageValue> MapProof<V>
[src]

[src]

Verifies the correctness of the proof by the trusted root hash and the requested key.

If the proof is valid and the requested key exists, Ok(Some(&V)) is returned. If the proof is valid and the requested key does not exists, Ok(None) is returned. If the proof is invalid, Err is returned.

Trait Implementations

impl<V: Serialize> Serialize for MapProof<V>
[src]

[src]

Serialize this value into the given Serde serializer. Read more

impl<V: Debug> Debug for MapProof<V>
[src]

[src]

Formats the value using the given formatter.