pub struct MokaCacheBuilder { /* private fields */ }Expand description
Builder for a Moka local in-memory cache provider.
Implementations§
Source§impl MokaCacheBuilder
impl MokaCacheBuilder
Sourcepub fn config(self, config: CacheConfig) -> Self
pub fn config(self, config: CacheConfig) -> Self
Replaces the builder config.
Sourcepub fn namespace(self, namespace: impl Into<String>) -> Self
pub fn namespace(self, namespace: impl Into<String>) -> Self
Sets the namespace prefix applied to logical cache keys.
Sourcepub fn time_to_live(self, time_to_live: Duration) -> Self
pub fn time_to_live(self, time_to_live: Duration) -> Self
Sets the default time to live for cache entries.
Sourcepub fn max_capacity(self, max_capacity: u64) -> Self
pub fn max_capacity(self, max_capacity: u64) -> Self
Sets the maximum weighted entry capacity.
Sourcepub fn build(self) -> MokaCacheProvider
pub fn build(self) -> MokaCacheProvider
Builds a Moka cache provider.
Trait Implementations§
Source§impl Clone for MokaCacheBuilder
impl Clone for MokaCacheBuilder
Source§fn clone(&self) -> MokaCacheBuilder
fn clone(&self) -> MokaCacheBuilder
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 MokaCacheBuilder
impl Debug for MokaCacheBuilder
Source§impl Default for MokaCacheBuilder
impl Default for MokaCacheBuilder
Source§fn default() -> MokaCacheBuilder
fn default() -> MokaCacheBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MokaCacheBuilder
impl RefUnwindSafe for MokaCacheBuilder
impl Send for MokaCacheBuilder
impl Sync for MokaCacheBuilder
impl Unpin for MokaCacheBuilder
impl UnsafeUnpin for MokaCacheBuilder
impl UnwindSafe for MokaCacheBuilder
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