pub struct CacheConfig { /* private fields */ }Expand description
Cache provider configuration shared by cache backends.
Implementations§
Source§impl CacheConfig
impl CacheConfig
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 namespace_value(&self) -> Option<&str>
pub fn namespace_value(&self) -> Option<&str>
Returns the configured namespace.
Sourcepub fn time_to_live_value(&self) -> Option<Duration>
pub fn time_to_live_value(&self) -> Option<Duration>
Returns the configured default time to live.
Sourcepub fn max_capacity_value(&self) -> Option<u64>
pub fn max_capacity_value(&self) -> Option<u64>
Returns the configured maximum capacity.
Trait Implementations§
Source§impl Clone for CacheConfig
impl Clone for CacheConfig
Source§fn clone(&self) -> CacheConfig
fn clone(&self) -> CacheConfig
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 CacheConfig
impl Debug for CacheConfig
Source§impl Default for CacheConfig
impl Default for CacheConfig
impl Eq for CacheConfig
Source§impl PartialEq for CacheConfig
impl PartialEq for CacheConfig
Source§fn eq(&self, other: &CacheConfig) -> bool
fn eq(&self, other: &CacheConfig) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for CacheConfig
Auto Trait Implementations§
impl Freeze for CacheConfig
impl RefUnwindSafe for CacheConfig
impl Send for CacheConfig
impl Sync for CacheConfig
impl Unpin for CacheConfig
impl UnsafeUnpin for CacheConfig
impl UnwindSafe for CacheConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.