1pub mod memory;
2
3use std::error::Error;
4use std::future::Future;
5use std::hash::Hash;
6
7#[cfg_attr(not(target_arch = "wasm32"), trait_variant::make(Send))]
8pub trait Store<K, V>
9where
10 K: Eq + Hash,
11 V: Clone,
12{
13 type Error: Error;
14
15 fn get(&self, key: &K) -> impl Future<Output = Result<Option<V>, Self::Error>>;
16 fn set(&self, key: K, value: V) -> impl Future<Output = Result<(), Self::Error>>;
17 fn del(&self, key: &K) -> impl Future<Output = Result<(), Self::Error>>;
18 fn clear(&self) -> impl Future<Output = Result<(), Self::Error>>;
19}