pub struct MemoryCacheStoreBuilder { /* private fields */ }Expand description
Builder for MemoryCacheStore with TTL / LRU options.
Implementations§
Source§impl MemoryCacheStoreBuilder
impl MemoryCacheStoreBuilder
Sourcepub fn max_entries(self, n: usize) -> Self
pub fn max_entries(self, n: usize) -> Self
Cap the number of cached entries; least-recently-used are evicted first.
Sourcepub fn max_age(self, age: Duration) -> Self
pub fn max_age(self, age: Duration) -> Self
Drop entries older than max_age on the next get that touches them
(or earlier, opportunistically on inserts that hit the capacity).
Sourcepub fn build(self) -> MemoryCacheStore
pub fn build(self) -> MemoryCacheStore
Finalize.
Trait Implementations§
Source§impl Clone for MemoryCacheStoreBuilder
impl Clone for MemoryCacheStoreBuilder
Source§fn clone(&self) -> MemoryCacheStoreBuilder
fn clone(&self) -> MemoryCacheStoreBuilder
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 MemoryCacheStoreBuilder
impl Debug for MemoryCacheStoreBuilder
Source§impl Default for MemoryCacheStoreBuilder
impl Default for MemoryCacheStoreBuilder
Source§fn default() -> MemoryCacheStoreBuilder
fn default() -> MemoryCacheStoreBuilder
Returns the “default value” for a type. Read more
impl Copy for MemoryCacheStoreBuilder
Auto Trait Implementations§
impl Freeze for MemoryCacheStoreBuilder
impl RefUnwindSafe for MemoryCacheStoreBuilder
impl Send for MemoryCacheStoreBuilder
impl Sync for MemoryCacheStoreBuilder
impl Unpin for MemoryCacheStoreBuilder
impl UnsafeUnpin for MemoryCacheStoreBuilder
impl UnwindSafe for MemoryCacheStoreBuilder
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