pub struct CacheConfig {
pub driver: Driver,
pub path: PathBuf,
pub url: String,
pub prefix: String,
pub sweep_interval: Duration,
}Fields§
§driver: Driver§path: PathBufWhere the file driver keeps its entries.
url: StringThe Redis URL, empty to fall back to REDIS_URL.
prefix: StringPrepended to every key. Two applications sharing one Redis need this;
note that Cache::flush on Redis still empties the whole database.
sweep_interval: DurationHow often the memory driver sweeps expired entries.
Implementations§
Source§impl CacheConfig
impl CacheConfig
Sourcepub fn from_app_config(config: &Config) -> Result<Self>
pub fn from_app_config(config: &Config) -> Result<Self>
Read cache.driver, cache.path, cache.url and cache.prefix.
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
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