Struct cached::stores::DiskCacheBuilder
source · pub struct DiskCacheBuilder<K, V> { /* private fields */ }
Implementations§
source§impl<K, V> DiskCacheBuilder<K, V>
impl<K, V> DiskCacheBuilder<K, V>
sourcepub fn new<S: AsRef<str>>(cache_name: S) -> DiskCacheBuilder<K, V>
pub fn new<S: AsRef<str>>(cache_name: S) -> DiskCacheBuilder<K, V>
Initialize a DiskCacheBuilder
sourcepub fn set_lifespan(self, seconds: u64) -> Self
pub fn set_lifespan(self, seconds: u64) -> Self
Specify the cache TTL/lifespan in seconds
sourcepub fn set_refresh(self, refresh: bool) -> Self
pub fn set_refresh(self, refresh: bool) -> Self
Specify whether cache hits refresh the TTL
sourcepub fn set_disk_directory<P: AsRef<Path>>(self, dir: P) -> Self
pub fn set_disk_directory<P: AsRef<Path>>(self, dir: P) -> Self
Set the disk path for where the data will be stored
pub fn build(self) -> Result<DiskCache<K, V>, DiskCacheBuildError>
Auto Trait Implementations§
impl<K, V> Freeze for DiskCacheBuilder<K, V>
impl<K, V> RefUnwindSafe for DiskCacheBuilder<K, V>where
K: RefUnwindSafe,
V: RefUnwindSafe,
impl<K, V> Send for DiskCacheBuilder<K, V>
impl<K, V> Sync for DiskCacheBuilder<K, V>
impl<K, V> Unpin for DiskCacheBuilder<K, V>
impl<K, V> UnwindSafe for DiskCacheBuilder<K, V>where
K: UnwindSafe,
V: UnwindSafe,
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