pub struct CachedProviderCatalog {
pub provider: String,
pub base_url_fingerprint: String,
pub fetched_at: u64,
pub ttl_secs: u64,
pub offerings: Vec<CatalogOffering>,
pub status: CatalogStatus,
}Expand description
A secret-free cached provider catalog for one provider + base-URL fingerprint.
Fields§
§provider: StringProvider id.
base_url_fingerprint: StringBase-URL fingerprint the rows were fetched from.
fetched_at: u64Unix seconds of the last successful fetch (unchanged on failure).
ttl_secs: u64Time-to-live, in seconds, after which rows are considered stale.
offerings: Vec<CatalogOffering>Cached live offering rows (possibly empty after a failure with no prior).
status: CatalogStatusLast known status of this entry.
Implementations§
Source§impl CachedProviderCatalog
impl CachedProviderCatalog
Sourcepub fn age_secs(&self, now_unix: u64) -> u64
pub fn age_secs(&self, now_unix: u64) -> u64
Age in seconds relative to now_unix, saturating at zero for clock skew.
Sourcepub fn is_stale(&self, now_unix: u64) -> bool
pub fn is_stale(&self, now_unix: u64) -> bool
Whether the cached rows are past their TTL at now_unix.
A ttl_secs of zero means “always stale” (never serve as fresh).
Sourcepub fn is_fresh(&self, now_unix: u64) -> bool
pub fn is_fresh(&self, now_unix: u64) -> bool
Whether this entry may contribute live offerings at now_unix.
An entry is fresh only when it is within its TTL and its last
recorded refresh succeeded. A Failed entry is never fresh even inside
its TTL window — its rows survive a failed refresh for explicit fallback
display via ProviderCatalogCache::get, but they are not served as
current live data.
Trait Implementations§
Source§impl Clone for CachedProviderCatalog
impl Clone for CachedProviderCatalog
Source§fn clone(&self) -> CachedProviderCatalog
fn clone(&self) -> CachedProviderCatalog
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more