pub struct MemoryCacheBuilder { /* private fields */ }Expand description
Builder for MemoryCache.
Implementations§
Source§impl MemoryCacheBuilder
impl MemoryCacheBuilder
Sourcepub fn max_capacity(self, capacity: u64) -> Self
pub fn max_capacity(self, capacity: u64) -> Self
Set max capacity.
Sourcepub fn time_to_live(self, ttl: Duration) -> Self
pub fn time_to_live(self, ttl: Duration) -> Self
Set TTL.
Sourcepub fn time_to_idle(self, tti: Duration) -> Self
pub fn time_to_idle(self, tti: Duration) -> Self
Set TTI.
Sourcepub fn per_entry_ttl(self, enabled: bool) -> Self
pub fn per_entry_ttl(self, enabled: bool) -> Self
Enable per-entry TTL.
Enable tags.
Sourcepub fn build(self) -> MemoryCache
pub fn build(self) -> MemoryCache
Build the cache.
Trait Implementations§
Source§impl Default for MemoryCacheBuilder
impl Default for MemoryCacheBuilder
Source§fn default() -> MemoryCacheBuilder
fn default() -> MemoryCacheBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MemoryCacheBuilder
impl RefUnwindSafe for MemoryCacheBuilder
impl Send for MemoryCacheBuilder
impl Sync for MemoryCacheBuilder
impl Unpin for MemoryCacheBuilder
impl UnwindSafe for MemoryCacheBuilder
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