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 from the store.
Object Safety§
This trait is not object safe.