pub struct MemoConfig {
pub max_entries: usize,
pub ttl: Option<Duration>,
pub eviction: MemoEvictionPolicy,
}Expand description
Configuration for a MemoCache.
Fields§
§max_entries: usizeMaximum number of entries the cache is allowed to hold.
ttl: Option<Duration>Optional time-to-live applied uniformly to every entry on access.
Entries that are still within ttl are not considered expired by the
Ttl eviction policy; however, setting this field does not automatically
enable TTL eviction — use MemoEvictionPolicy::Ttl for that.
eviction: MemoEvictionPolicyThe eviction policy used when the cache is at capacity.
Trait Implementations§
Source§impl Clone for MemoConfig
impl Clone for MemoConfig
Source§fn clone(&self) -> MemoConfig
fn clone(&self) -> MemoConfig
Returns a duplicate of the value. Read more
1.0.0 · 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 MemoConfig
impl Debug for MemoConfig
Auto Trait Implementations§
impl Freeze for MemoConfig
impl RefUnwindSafe for MemoConfig
impl Send for MemoConfig
impl Sync for MemoConfig
impl Unpin for MemoConfig
impl UnsafeUnpin for MemoConfig
impl UnwindSafe for MemoConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more