pub struct DomainCache {
pub root: PathBuf,
pub domain: String,
}Expand description
Domain-specific cache operations
Fields§
§root: PathBuf§domain: StringImplementations§
Source§impl DomainCache
impl DomainCache
Sourcepub fn mycelium_dir(&self) -> PathBuf
pub fn mycelium_dir(&self) -> PathBuf
Get the mycelium metadata directory
Sourcepub fn spore_path(&self, hash: &str) -> PathBuf
pub fn spore_path(&self, hash: &str) -> PathBuf
Get the cache path for a specific spore
Sourcepub fn repo_path(&self, root_commit: &str) -> PathBuf
pub fn repo_path(&self, root_commit: &str) -> PathBuf
Get the cache path for a specific repository by root_commit
The root_commit is the SHA of the first commit in the repository, which serves as a stable identifier for the repository.
Sourcepub fn save_cmn(&self, entry: &CmnEntry) -> Result<(), HyphaError>
pub fn save_cmn(&self, entry: &CmnEntry) -> Result<(), HyphaError>
Save cmn.json entry to cache
Sourcepub fn mycelium_path(&self) -> PathBuf
pub fn mycelium_path(&self) -> PathBuf
Get path to mycelium.json (complete manifest with spores list)
Sourcepub fn load_mycelium(&self) -> Option<Value>
pub fn load_mycelium(&self) -> Option<Value>
Load cached full mycelium manifest
Sourcepub fn save_mycelium(&self, mycelium: &Value) -> Result<(), HyphaError>
pub fn save_mycelium(&self, mycelium: &Value) -> Result<(), HyphaError>
Save full mycelium manifest to cache
Sourcepub fn status_path(&self) -> PathBuf
pub fn status_path(&self) -> PathBuf
Get path to status.json
Sourcepub fn load_status(&self) -> CacheStatus
pub fn load_status(&self) -> CacheStatus
Load cache status
Sourcepub fn save_status(&self, status: &CacheStatus) -> Result<(), HyphaError>
pub fn save_status(&self, status: &CacheStatus) -> Result<(), HyphaError>
Save cache status
Sourcepub fn domain_taste_path(&self) -> PathBuf
pub fn domain_taste_path(&self) -> PathBuf
Get path to domain-level taste.json
Sourcepub fn load_domain_taste(&self) -> Option<TasteVerdictCache>
pub fn load_domain_taste(&self) -> Option<TasteVerdictCache>
Load cached taste verdict for the domain itself
Sourcepub fn save_domain_taste(
&self,
verdict: &TasteVerdictCache,
) -> Result<(), HyphaError>
pub fn save_domain_taste( &self, verdict: &TasteVerdictCache, ) -> Result<(), HyphaError>
Save taste verdict for the domain itself
Sourcepub fn taste_path(&self, hash: &str) -> PathBuf
pub fn taste_path(&self, hash: &str) -> PathBuf
Get path to taste.json for a spore
Sourcepub fn load_taste(&self, hash: &str) -> Option<TasteVerdictCache>
pub fn load_taste(&self, hash: &str) -> Option<TasteVerdictCache>
Load cached taste verdict for a spore
Sourcepub fn save_taste(
&self,
hash: &str,
verdict: &TasteVerdictCache,
) -> Result<(), HyphaError>
pub fn save_taste( &self, hash: &str, verdict: &TasteVerdictCache, ) -> Result<(), HyphaError>
Save taste verdict for a spore
Sourcepub fn key_trust_path(&self) -> PathBuf
pub fn key_trust_path(&self) -> PathBuf
Get path to key_trust.json for this domain
Sourcepub fn load_key_trust(&self) -> Vec<KeyTrustEntry>
pub fn load_key_trust(&self) -> Vec<KeyTrustEntry>
Load cached key trust entries
Sourcepub fn save_key_trust(&self, key: &str) -> Result<(), HyphaError>
pub fn save_key_trust(&self, key: &str) -> Result<(), HyphaError>
Save a key trust entry (domain confirmed this key)
Sourcepub fn is_key_trusted(
&self,
key: &str,
ttl_ms: u64,
clock_skew_tolerance_ms: u64,
) -> bool
pub fn is_key_trusted( &self, key: &str, ttl_ms: u64, clock_skew_tolerance_ms: u64, ) -> bool
Check if a key is trusted within the given TTL (milliseconds). Applies clock skew tolerance to prevent false negatives from clock drift.
Sourcepub fn update_cmn_status(&self, success: bool, error: Option<&str>)
pub fn update_cmn_status(&self, success: bool, error: Option<&str>)
Update cmn.json fetch status