pub struct HealthStore {
pub version: u32,
pub updated_at: DateTime<Utc>,
pub records: BTreeMap<String, ModelVerification>,
}Expand description
The versioned health store: one ModelVerification per model id, keyed
by model_id. Lives at Config::cache_dir()/model-health.json, written
atomically (sibling .tmp + rename, 0o600).
Fields§
§version: u32File layout version (HEALTH_STORE_VERSION).
updated_at: DateTime<Utc>Last write time (RFC 3339).
records: BTreeMap<String, ModelVerification>Verification records keyed by model id.
Implementations§
Source§impl HealthStore
impl HealthStore
Sourcepub fn upsert(&mut self, verification: ModelVerification)
pub fn upsert(&mut self, verification: ModelVerification)
Insert or replace one model’s verification record and bump
updated_at. Other models’ records are preserved.
Sourcepub fn get(&self, model_id: &str) -> Option<&ModelVerification>
pub fn get(&self, model_id: &str) -> Option<&ModelVerification>
Read one model’s record.
Trait Implementations§
Source§impl Clone for HealthStore
impl Clone for HealthStore
Source§fn clone(&self) -> HealthStore
fn clone(&self) -> HealthStore
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HealthStore
impl Debug for HealthStore
Source§impl Default for HealthStore
impl Default for HealthStore
Source§impl<'de> Deserialize<'de> for HealthStore
impl<'de> Deserialize<'de> for HealthStore
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
Auto Trait Implementations§
impl Freeze for HealthStore
impl RefUnwindSafe for HealthStore
impl Send for HealthStore
impl Sync for HealthStore
impl Unpin for HealthStore
impl UnsafeUnpin for HealthStore
impl UnwindSafe for HealthStore
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