Trait 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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§