[][src]Trait exonum::storage::proof_map_index::ProofMapKey

pub trait ProofMapKey where
    Self::Output: ProofMapKey
{ type Output; fn write_key(&self, _: &mut [u8]);
fn read_key(_: &[u8]) -> Self::Output; }

A trait that defines a subset of storage key types which are suitable for use with ProofMapIndex.

The size of the keys must be exactly PROOF_MAP_KEY_SIZE bytes and the keys must have a uniform distribution.

Associated Types

type Output

The type of keys as read from the database.

Output is not necessarily equal to Self, which provides flexibility for HashedKeys and similar cases where the key cannot be uniquely restored from the database.

Loading content...

Required methods

fn write_key(&self, _: &mut [u8])

Writes this key into a byte buffer.

The buffer is guaranteed to have size PROOF_MAP_KEY_SIZE.

fn read_key(_: &[u8]) -> Self::Output

Reads this key from the buffer.

Loading content...

Implementations on Foreign Types

impl ProofMapKey for [u8; 32]
[src]

type Output = [u8; 32]

Loading content...

Implementors

impl ProofMapKey for Hash
[src]

type Output = Self

impl ProofMapKey for PublicKey
[src]

type Output = Self

impl<T: HashedKey> ProofMapKey for T
[src]

type Output = Hash

Loading content...