WriteToStore

Trait WriteToStore 

Source
pub trait WriteToStore<S: WritableStore> {
    // Required method
    fn write(
        &self,
        tx: &mut S::Transaction<'_>,
    ) -> impl Future<Output = Result<(), S::Error>>;
}
Expand description

Writes state changes into a store as part of an atomic transaction.

Developers should implement this trait on types which represent state which needs persisting or the “delta” which needs changing. On write the concrete query (for example a SQL insert or update) is executed as part of an atomic transaction.

The “written” object can usually be dropped after a successful transaction.

Required Methods§

Source

fn write( &self, tx: &mut S::Transaction<'_>, ) -> impl Future<Output = Result<(), S::Error>>

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§