pub trait CacheStore:
Send
+ Sync
+ 'static {
type Error: StdError + Sync + Send + 'static;
type Key: Hash + Eq + Send + Clone + 'static;
// Required methods
fn load_entry<Q>(
&self,
key: &Q,
) -> impl Future<Output = Option<CachedEntry>> + Send
where Self::Key: Borrow<Q>,
Q: Hash + Eq + Sync;
fn save_entry(
&self,
key: Self::Key,
data: CachedEntry,
) -> impl Future<Output = Result<(), Self::Error>> + Send;
}Expand description
Store cache.
Required Associated Types§
Required Methods§
Sourcefn load_entry<Q>(
&self,
key: &Q,
) -> impl Future<Output = Option<CachedEntry>> + Send
fn load_entry<Q>( &self, key: &Q, ) -> impl Future<Output = Option<CachedEntry>> + Send
Get the cache item from the store.
Sourcefn save_entry(
&self,
key: Self::Key,
data: CachedEntry,
) -> impl Future<Output = Result<(), Self::Error>> + Send
fn save_entry( &self, key: Self::Key, data: CachedEntry, ) -> impl Future<Output = Result<(), Self::Error>> + Send
Save the cache item to the store.
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.