Struct salvo_cache::memory_store::MemoryStore
source · pub struct MemoryStore<K> { /* private fields */ }
Available on crate feature
memory-store
only.Expand description
A simple in-memory store for rate limiter.
Implementations§
Trait Implementations§
source§impl<K> CacheStore for MemoryStore<K>where
K: Hash + Eq + Send + Sync + Clone + 'static,
impl<K> CacheStore for MemoryStore<K>where
K: Hash + Eq + Send + Sync + Clone + 'static,
§type Error = Infallible
type Error = Infallible
Error type for CacheStore.
source§fn load_entry<'life0, 'life1, 'async_trait, Q>(
&'life0 self,
key: &'life1 Q
) -> Pin<Box<dyn Future<Output = Option<CachedEntry>> + Send + 'async_trait>>where
Self::Key: Borrow<Q>,
Q: Hash + Eq + Sync + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_entry<'life0, 'life1, 'async_trait, Q>(
&'life0 self,
key: &'life1 Q
) -> Pin<Box<dyn Future<Output = Option<CachedEntry>> + Send + 'async_trait>>where
Self::Key: Borrow<Q>,
Q: Hash + Eq + Sync + 'async_trait,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get the cache item from the store.