pub struct Builder { /* private fields */ }
Expand description
Builder for moka backend
Implementations§
source§impl Builder
impl Builder
sourcepub fn max_capacity(&mut self, v: u64) -> &mut Self
pub fn max_capacity(&mut self, v: u64) -> &mut Self
Sets the max capacity of the cache.
sourcepub fn time_to_live(&mut self, v: Duration) -> &mut Self
pub fn time_to_live(&mut self, v: Duration) -> &mut Self
Sets the time to live of the cache.
sourcepub fn time_to_idle(&mut self, v: Duration) -> &mut Self
pub fn time_to_idle(&mut self, v: Duration) -> &mut Self
Sets the time to idle of the cache.
sourcepub fn segments(&mut self, v: usize) -> &mut Self
pub fn segments(&mut self, v: usize) -> &mut Self
Sets the segments number of the cache.
Refer to moka::sync::CacheBuilder::segments
sourcepub fn thread_pool_enabled(&mut self, v: bool) -> &mut Self
pub fn thread_pool_enabled(&mut self, v: bool) -> &mut Self
Decides whether to enable thread pool of the cache.