Trait Store

Source
pub trait Store<K, V>: Send
where K: Eq + Hash, V: Clone,
{ type Error: Error; // Required methods fn get( &self, key: &K, ) -> impl Future<Output = Result<Option<V>, Self::Error>> + Send; fn set( &self, key: K, value: V, ) -> impl Future<Output = Result<(), Self::Error>> + Send; fn del( &self, key: &K, ) -> impl Future<Output = Result<(), Self::Error>> + Send; fn clear(&self) -> impl Future<Output = Result<(), Self::Error>> + Send; }

Required Associated Types§

Required Methods§

Source

fn get( &self, key: &K, ) -> impl Future<Output = Result<Option<V>, Self::Error>> + Send

Source

fn set( &self, key: K, value: V, ) -> impl Future<Output = Result<(), Self::Error>> + Send

Source

fn del(&self, key: &K) -> impl Future<Output = Result<(), Self::Error>> + Send

Source

fn clear(&self) -> impl Future<Output = Result<(), Self::Error>> + Send

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<K, V> Store<K, V> for MemoryStore<K, V>
where K: Debug + Eq + Hash + Send + Sync + 'static, V: Debug + Clone + Send + Sync + 'static,