pub trait Cache: Send {
type Input: Hash + Eq + Sync + 'static;
type Output: Clone + Sync + 'static;
// Required methods
fn new(config: CacheConfig) -> Self;
fn get(
&self,
key: &Self::Input,
) -> impl Future<Output = Option<Self::Output>> + Send;
fn set(
&self,
key: Self::Input,
value: Self::Output,
) -> impl Future<Output = ()> + Send;
}Required Associated Types§
Required Methods§
fn new(config: CacheConfig) -> Self
fn get( &self, key: &Self::Input, ) -> impl Future<Output = Option<Self::Output>> + Send
fn set( &self, key: Self::Input, value: Self::Output, ) -> impl Future<Output = ()> + 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.