pub struct ModelManagementStore { /* private fields */ }Implementations§
Source§impl ModelManagementStore
impl ModelManagementStore
pub fn new(state_root: PathBuf, models_dir: PathBuf) -> Self
pub fn models_dir(&self) -> &Path
pub fn management_state_dir(&self) -> &Path
pub fn receipts_root(&self) -> &Path
pub fn receipt_path(&self, model_id: &str) -> PathBuf
pub fn tombstones_root(&self) -> &Path
pub fn tombstone_path(&self, model_id: &str) -> PathBuf
pub fn leases_root(&self) -> &Path
pub fn lease_path(&self, model_id: &str) -> PathBuf
pub fn mutation_lock_path(&self, model_id: &str) -> PathBuf
pub fn load_receipt( &self, model_id: &str, ) -> Result<Option<InstallReceipt>, ModelManagementError>
Sourcepub fn can_remove(&self, model_id: &str) -> Result<bool, ModelManagementError>
pub fn can_remove(&self, model_id: &str) -> Result<bool, ModelManagementError>
Return whether CAR has a receipt whose current artifact still matches the ownership evidence recorded at install/adoption time.
pub fn acquire_lease( &self, model_id: &str, ) -> Result<ModelLease, ModelManagementError>
Sourcepub fn start_usage_tracking(&self)
pub fn start_usage_tracking(&self)
Mark when usage tracking began on this machine, once. Until a model has gone unstamped for longer than an idle threshold since this moment, its silence is no evidence: the day stamping ships, every model is unstamped.
The daemon calls this at startup, and nothing else may: the process that serves the models is the one whose leases stamp them. A newer CLI or test starting the clock while an older daemon serves unstamped would make every model look idle a month later.
Sourcepub fn beat(&self)
pub fn beat(&self)
Record that a usage-stamping daemon is up now. The run continues from
the previous beat when that beat was this process’s own and less than
COVERAGE_GAP_SECS of awake time ago (a sleeping machine pauses the
clock rather than breaking the run), or when another stamping process
beat within that window of wall time (a restart). Otherwise a run
starts now. Daemon only, like Self::start_usage_tracking.
Sourcepub fn usage_covered_since(&self) -> Option<u64>
pub fn usage_covered_since(&self) -> Option<u64>
Since when a usage-stamping daemon has been continuously up, if one is.
Sourcepub fn usage_tracking_since(&self) -> Option<u64>
pub fn usage_tracking_since(&self) -> Option<u64>
When usage tracking began on this machine, if it has.
Sourcepub fn last_used(&self, model_id: &str) -> Option<u64>
pub fn last_used(&self, model_id: &str) -> Option<u64>
When model_id was last used, if it ever was since tracking began.
pub fn model_in_use(&self, model_id: &str) -> Result<bool, ModelManagementError>
pub fn car_enabled(&self, model_id: &str) -> Result<bool, ModelManagementError>
Source§impl ModelManagementStore
impl ModelManagementStore
Sourcepub fn resume_retiring(&self) -> Vec<ModelManagementError>
pub fn resume_retiring(&self) -> Vec<ModelManagementError>
Finish retirements whose model removal completed but whose tombstone was never cleared. An intent whose removal has not completed — the receipt is still there — is kept while a removal journal can still finish it, and dropped once nothing can.
Sourcepub fn resume_detached_trees(&self) -> Vec<ModelManagementError>
pub fn resume_detached_trees(&self) -> Vec<ModelManagementError>
Finish retirements a crash interrupted: a journaled quarantine still on disk is deleted (identity-checked); a journal whose rename never happened is dropped. Daemon start only.
Trait Implementations§
Source§impl Clone for ModelManagementStore
impl Clone for ModelManagementStore
Auto Trait Implementations§
impl Freeze for ModelManagementStore
impl RefUnwindSafe for ModelManagementStore
impl Send for ModelManagementStore
impl Sync for ModelManagementStore
impl Unpin for ModelManagementStore
impl UnsafeUnpin for ModelManagementStore
impl UnwindSafe for ModelManagementStore
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more