pub trait Store<K, V>: Send{
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§
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
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.