pub struct CachedResponseExpiry;Available on crate feature
moka only.Expand description
Moka Expiry for CachedResponse.
Trait Implementations§
Source§impl<CacheKeyT> Expiry<CacheKeyT, Arc<CachedResponse>> for CachedResponseExpirywhere
CacheKeyT: CacheKey,
impl<CacheKeyT> Expiry<CacheKeyT, Arc<CachedResponse>> for CachedResponseExpirywhere
CacheKeyT: CacheKey,
Source§fn expire_after_create(
&self,
_cache_key: &CacheKeyT,
cached_response: &CachedResponseRef,
_created_at: Instant,
) -> Option<Duration>
fn expire_after_create( &self, _cache_key: &CacheKeyT, cached_response: &CachedResponseRef, _created_at: Instant, ) -> Option<Duration>
Specifies that the entry should be automatically removed from the cache once
the duration has elapsed after the entry’s creation. This method is called
for cache write methods such as
insert and get_with but only when the key
was not present in the cache. Read moreSource§fn expire_after_read(
&self,
key: &K,
value: &V,
read_at: Instant,
duration_until_expiry: Option<Duration>,
last_modified_at: Instant,
) -> Option<Duration>
fn expire_after_read( &self, key: &K, value: &V, read_at: Instant, duration_until_expiry: Option<Duration>, last_modified_at: Instant, ) -> Option<Duration>
Specifies that the entry should be automatically removed from the cache once
the duration has elapsed after its last read. This method is called for cache
read methods such as
get and get_with but only when the key is present in
the cache. Read moreSource§fn expire_after_update(
&self,
key: &K,
value: &V,
updated_at: Instant,
duration_until_expiry: Option<Duration>,
) -> Option<Duration>
fn expire_after_update( &self, key: &K, value: &V, updated_at: Instant, duration_until_expiry: Option<Duration>, ) -> Option<Duration>
Specifies that the entry should be automatically removed from the cache once
the duration has elapsed after the replacement of its value. This method is
called for cache write methods such as
insert but only when the key is
already present in the cache. Read moreAuto Trait Implementations§
impl Freeze for CachedResponseExpiry
impl RefUnwindSafe for CachedResponseExpiry
impl Send for CachedResponseExpiry
impl Sync for CachedResponseExpiry
impl Unpin for CachedResponseExpiry
impl UnsafeUnpin for CachedResponseExpiry
impl UnwindSafe for CachedResponseExpiry
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