pub struct CacheDir {
pub root: PathBuf,
pub cmn_ttl_ms: u64,
pub max_download_bytes: u64,
pub max_extract_bytes: u64,
pub max_extract_files: u64,
pub max_extract_file_bytes: u64,
}Expand description
Cache directory structure
Fields§
§root: PathBuf§cmn_ttl_ms: u64§max_download_bytes: u64§max_extract_bytes: u64§max_extract_files: u64§max_extract_file_bytes: u64Implementations§
Source§impl CacheDir
impl CacheDir
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a new CacheDir under $CMN_HOME/hypha/cache/ (or [cache] path from config.toml)
Sourcepub fn domain(&self, domain: &str) -> DomainCache
pub fn domain(&self, domain: &str) -> DomainCache
Get the domain cache helper
Sourcepub fn spore_path(&self, domain: &str, hash: &str) -> PathBuf
pub fn spore_path(&self, domain: &str, hash: &str) -> PathBuf
Get the cache path for a specific spore (legacy compatibility) Structure: ~/.cmn/cache/{domain}/spore/{hash}/
Sourcepub fn list_all(&self) -> Vec<CachedSpore>
pub fn list_all(&self) -> Vec<CachedSpore>
List all cached spores
Sourcepub fn clean_all(&self) -> Result<usize, HyphaError>
pub fn clean_all(&self) -> Result<usize, HyphaError>
Remove all cached items
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CacheDir
impl RefUnwindSafe for CacheDir
impl Send for CacheDir
impl Sync for CacheDir
impl Unpin for CacheDir
impl UnsafeUnpin for CacheDir
impl UnwindSafe for CacheDir
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