pub struct DiskCacheConfig {
pub root_cache_key: String,
}Expand description
Cache Policy
Fields§
§root_cache_key: StringKey for the root cache directory.
Implementations§
Source§impl DiskCacheConfig
impl DiskCacheConfig
Sourcepub fn with_root_cache_key(self, root_cache_key: String) -> Self
pub fn with_root_cache_key(self, root_cache_key: String) -> Self
Sets the value for the field root_cache_key.
Key for the root cache directory.
- Defaults to
"\"bimm\".to_string()"
Source§impl DiskCacheConfig
impl DiskCacheConfig
Sourcepub fn base_cache_dir(&self) -> Result<PathBuf>
pub fn base_cache_dir(&self) -> Result<PathBuf>
Fetch the base cache directory.
If the cache directory does not exist, does not create it.
Sourcepub fn ensure_base_cache_dir(&self) -> Result<PathBuf>
pub fn ensure_base_cache_dir(&self) -> Result<PathBuf>
Fetch the base cache directory.
If the cache directory does not exist, creates it.
Sourcepub fn resource_to_path(&self, resource_key: &[String]) -> Result<PathBuf>
pub fn resource_to_path(&self, resource_key: &[String]) -> Result<PathBuf>
Map a resource key to a cache path.
Does not ensure that the path (or any of the parents) exist.
Sourcepub fn ensure_resource_parent_dir(
&self,
resource_key: &[String],
) -> Result<PathBuf>
pub fn ensure_resource_parent_dir( &self, resource_key: &[String], ) -> Result<PathBuf>
Map a resource key to a cache path and ensure the parent directory exists.
Trait Implementations§
Source§impl Clone for DiskCacheConfig
impl Clone for DiskCacheConfig
Source§impl Config for DiskCacheConfig
impl Config for DiskCacheConfig
Source§fn load<P>(file: P) -> Result<Self, ConfigError>
fn load<P>(file: P) -> Result<Self, ConfigError>
Loads the configuration from a file. Read more
Source§fn load_binary(data: &[u8]) -> Result<Self, ConfigError>
fn load_binary(data: &[u8]) -> Result<Self, ConfigError>
Loads the configuration from a binary buffer. Read more
Source§impl Debug for DiskCacheConfig
impl Debug for DiskCacheConfig
Source§impl Default for DiskCacheConfig
impl Default for DiskCacheConfig
Source§impl<'de> Deserialize<'de> for DiskCacheConfig
impl<'de> Deserialize<'de> for DiskCacheConfig
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for DiskCacheConfig
impl Display for DiskCacheConfig
Auto Trait Implementations§
impl Freeze for DiskCacheConfig
impl RefUnwindSafe for DiskCacheConfig
impl Send for DiskCacheConfig
impl Sync for DiskCacheConfig
impl Unpin for DiskCacheConfig
impl UnsafeUnpin for DiskCacheConfig
impl UnwindSafe for DiskCacheConfig
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