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§
Auto Trait Implementations§
impl Forget for MemoryCacheBuilder
impl Freeze for MemoryCacheBuilder
impl Move for MemoryCacheBuilder
impl RefUnwindSafe for MemoryCacheBuilder
impl Send for MemoryCacheBuilder
impl Sync for MemoryCacheBuilder
impl Unpin for MemoryCacheBuilder
impl UnsafeUnpin 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