pub struct InMemoryCache { /* private fields */ }Expand description
In-memory RwLock<HashMap> cache for single-process deployments.
Lookups are non-blocking; writes take the write lock briefly. For high-cardinality deployments swap for a sharded or out-of-process store.
Implementations§
Trait Implementations§
Source§impl Cache for InMemoryCache
impl Cache for InMemoryCache
Source§fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
recipient_domain: &'life1 str,
) -> Pin<Box<dyn Future<Output = Option<CachedPolicy>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
recipient_domain: &'life1 str,
) -> Pin<Box<dyn Future<Output = Option<CachedPolicy>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Read the cached policy for
recipient_domain. Returns None
if there’s no entry (caller must do the full TXT + HTTPS
dance).Source§impl Clone for InMemoryCache
impl Clone for InMemoryCache
Source§fn clone(&self) -> InMemoryCache
fn clone(&self) -> InMemoryCache
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InMemoryCache
impl Debug for InMemoryCache
Source§impl Default for InMemoryCache
impl Default for InMemoryCache
Source§fn default() -> InMemoryCache
fn default() -> InMemoryCache
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for InMemoryCache
impl !UnwindSafe for InMemoryCache
impl Freeze for InMemoryCache
impl Send for InMemoryCache
impl Sync for InMemoryCache
impl Unpin for InMemoryCache
impl UnsafeUnpin for InMemoryCache
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more