logo
pub trait StateReader<K, V> {
    type Error;
    fn read(
        &self,
        correlation_id: CorrelationId,
        key: &K
    ) -> Result<Option<V>, Self::Error>; fn read_with_proof(
        &self,
        correlation_id: CorrelationId,
        key: &K
    ) -> Result<Option<TrieMerkleProof<K, V>>, Self::Error>; fn keys_with_prefix(
        &self,
        correlation_id: CorrelationId,
        prefix: &[u8]
    ) -> Result<Vec<K>, Self::Error>; }
Expand description

A trait expressing the reading of state. This trait is used to abstract the underlying store.

Associated Types

An error which occurs when reading state

Required methods

Returns the state value from the corresponding key

Returns the merkle proof of the state value from the corresponding key

Returns the keys in the trie matching prefix.

Implementors