pub struct CacheConfig {
pub prefix: Option<String>,
pub default_ttl: Option<Duration>,
pub max_entries: Option<usize>,
}Expand description
Cache configuration
Fields§
§prefix: Option<String>Key prefix for namespacing
default_ttl: Option<Duration>Default TTL for entries
max_entries: Option<usize>Maximum number of entries (for memory cache)
Implementations§
Source§impl CacheConfig
impl CacheConfig
Sourcepub fn default_ttl(self, ttl: Duration) -> Self
pub fn default_ttl(self, ttl: Duration) -> Self
Set the default TTL
Sourcepub fn max_entries(self, max: usize) -> Self
pub fn max_entries(self, max: usize) -> Self
Set the maximum number of entries
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 · 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
Source§fn default() -> CacheConfig
fn default() -> CacheConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CacheConfig
impl RefUnwindSafe for CacheConfig
impl Send for CacheConfig
impl Sync for CacheConfig
impl Unpin 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