pub struct MokaCacheExpiry;Trait Implementations§
Source§impl Expiry<String, (Expiration, Vec<u8>)> for MokaCacheExpiry
impl Expiry<String, (Expiration, Vec<u8>)> for MokaCacheExpiry
Source§fn expire_after_create(
&self,
_key: &String,
value: &(Expiration, Vec<u8>),
_current_time: Instant,
) -> Option<Duration>
fn expire_after_create( &self, _key: &String, value: &(Expiration, Vec<u8>), _current_time: 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 MokaCacheExpiry
impl RefUnwindSafe for MokaCacheExpiry
impl Send for MokaCacheExpiry
impl Sync for MokaCacheExpiry
impl Unpin for MokaCacheExpiry
impl UnsafeUnpin for MokaCacheExpiry
impl UnwindSafe for MokaCacheExpiry
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