[][src]Trait orga::store::Read

pub trait Read: Sized {
    fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>>;

    fn wrap<T: State<Self>>(self) -> Result<T> { ... }
fn into_shared(self) -> Shared<Self> { ... }
fn prefix(self, prefix: u8) -> Prefixed<Self> { ... }
fn into_splitter(self) -> Splitter<Self> { ... }
fn as_ref<'a>(&'a self) -> &'a Self { ... } }

Trait for read access to key/value stores.

Required methods

fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>>

Gets a value by key.

Implementations of get should return None when there is no value for the key rather than erroring.

Loading content...

Provided methods

fn wrap<T: State<Self>>(self) -> Result<T>

Wraps self with a given state::State implementation, provided for convenience.

fn into_shared(self) -> Shared<Self>

Wraps self with Shared, allowing it to be cloned so that multiple callers can share the reference to the underlying store.

fn prefix(self, prefix: u8) -> Prefixed<Self>

Wraps self with Prefixed using the given prefix byte, so that all operations have the prefix prepended to their keys.

fn into_splitter(self) -> Splitter<Self>

Wraps self with Splitter so that prefixed substores may be created by calling .split().

fn as_ref<'a>(&'a self) -> &'a Self

Returns an immutable reference to the store.

Loading content...

Implementors

impl Read for MemStore[src]

impl Read for TendermintClient[src]

fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>>[src]

Gets a value from the store by making a raw key query to the Tendermint RPC server. The raw response bytes will be returned, which may include unverified proof bytes depending on the node's ABCIStore implementation.

impl Read for NullStore[src]

impl<'a> Read for MerkStore<'a>[src]

fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>>[src]

Gets a value from the underlying Merk store.

impl<R: Read> Read for Client<R>[src]

fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>>[src]

Gets a value for the given key, then decodes the response as a Merk proof and verifies it, returning the extracted value.

impl<R: Read> Read for Prefixed<R>[src]

impl<R: Read> Read for Shared<R>[src]

impl<S: Read, T: Deref<Target = S>> Read for T[src]

impl<S: Store> Read for BufStore<S>[src]

impl<S: Store> Read for RWLog<S>[src]

Loading content...