Trait essential_storage::StateStorage

source ·
pub trait StateStorage: QueryState {
    // Required methods
    fn update_state(
        &self,
        address: &ContentAddress,
        key: &Key,
        value: Vec<Word>,
    ) -> impl Future<Output = Result<Vec<Word>>> + Send;
    fn update_state_batch<U>(
        &self,
        updates: U,
    ) -> impl Future<Output = Result<Vec<Vec<Word>>>> + Send
       where U: IntoIterator<Item = (ContentAddress, Key, Vec<Word>)> + Send;
}
Expand description

Storage trait just for state reads and writes.

Required Methods§

source

fn update_state( &self, address: &ContentAddress, key: &Key, value: Vec<Word>, ) -> impl Future<Output = Result<Vec<Word>>> + Send

Update the state of a content address.

source

fn update_state_batch<U>( &self, updates: U, ) -> impl Future<Output = Result<Vec<Vec<Word>>>> + Send
where U: IntoIterator<Item = (ContentAddress, Key, Vec<Word>)> + Send,

Update a batch of state in one transaction.

Object Safety§

This trait is not object safe.

Implementors§