pub trait State {
// Required methods
fn get(&self, key: &Key) -> impl Future<Output = Option<Value>>;
fn insert(&mut self, key: Key, value: Value) -> impl Future<Output = ()>;
fn delete(&mut self, key: &Key) -> impl Future<Output = ()>;
// Provided method
fn apply(&mut self, changes: Vec<(Key, Status)>) -> impl Future<Output = ()> { ... }
}Required Methods§
fn get(&self, key: &Key) -> impl Future<Output = Option<Value>>
fn insert(&mut self, key: Key, value: Value) -> impl Future<Output = ()>
fn delete(&mut self, key: &Key) -> impl Future<Output = ()>
Provided Methods§
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.