State

Trait State 

Source
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§

Source

fn get(&self, key: &Key) -> impl Future<Output = Option<Value>>

Source

fn insert(&mut self, key: Key, value: Value) -> impl Future<Output = ()>

Source

fn delete(&mut self, key: &Key) -> impl Future<Output = ()>

Provided Methods§

Source

fn apply(&mut self, changes: Vec<(Key, Status)>) -> impl Future<Output = ()>

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§

Source§

impl State for Memory

Source§

impl<'a, S: State> State for Layer<'a, S>

Source§

impl<'a, S: State> State for Noncer<'a, S>

Source§

impl<E: Spawner + Metrics + Clock + Storage, T: Translator> State for Adb<E, T>