pub struct OptionalParserPackLifecycle { /* private fields */ }Expand description
Concrete owner of project selection and user-owned immutable pack slots.
Implementations§
Source§impl OptionalParserPackLifecycle
impl OptionalParserPackLifecycle
Sourcepub fn new(
project_root: impl Into<PathBuf>,
storage_root: Option<PathBuf>,
) -> Result<Self, OptionalParserPackLifecycleError>
pub fn new( project_root: impl Into<PathBuf>, storage_root: Option<PathBuf>, ) -> Result<Self, OptionalParserPackLifecycleError>
Construct lifecycle ownership without opening archives or touching the filesystem.
storage_root is a hidden test/managed-install override. Normal callers pass None;
the platform’s user-owned application data directory is resolved only if a later
operation actually needs parser-pack storage.
§Errors
Construction currently preserves the fallible public signature for compatibility but
performs no storage lookup. A storage-dependent operation reports
OptionalParserPackLifecycleError::StorageRootUnavailable when the deferred platform
root cannot be derived.
Sourcepub fn verify(
&self,
archive: &Path,
) -> Result<OptionalParserPackLifecycleReport, OptionalParserPackLifecycleError>
pub fn verify( &self, archive: &Path, ) -> Result<OptionalParserPackLifecycleReport, OptionalParserPackLifecycleError>
Verify and fixture-probe one local completed archive without installing it.
§Errors
Returns unsupported containment before opening the archive, or an archive, manifest, digest, platform, path, bound, or supervisor-admission failure.
Sourcepub fn install(
&self,
archive: &Path,
) -> Result<OptionalParserPackLifecycleReport, OptionalParserPackLifecycleError>
pub fn install( &self, archive: &Path, ) -> Result<OptionalParserPackLifecycleReport, OptionalParserPackLifecycleError>
Install one local completed archive into an immutable versioned slot.
Installation never enables the slot for this or another project.
§Errors
Returns unsupported containment before opening the archive or mutating storage, or a validation, admission, publication, or filesystem failure.
Sourcepub fn enable(
&self,
artifact: &str,
) -> Result<OptionalParserPackLifecycleReport, OptionalParserPackLifecycleError>
pub fn enable( &self, artifact: &str, ) -> Result<OptionalParserPackLifecycleReport, OptionalParserPackLifecycleError>
Enable an explicitly named already installed slot for the current project.
Passing the artifact reported in status.rollback is the canonical explicit rollback:
the retained slot becomes selected and the displaced selection becomes rollback-ready.
§Errors
Returns unsupported containment before state inspection or mutation, or a slot, selection, manifest, digest, admission, or atomic-publication failure.
Sourcepub fn update(
&self,
archive: &Path,
) -> Result<OptionalParserPackLifecycleReport, OptionalParserPackLifecycleError>
pub fn update( &self, archive: &Path, ) -> Result<OptionalParserPackLifecycleReport, OptionalParserPackLifecycleError>
Install and atomically select a replacement, retaining the previous exact slot.
Selection publication is the update commit point. A failed install or verification publishes no candidate. If selection publication fails after a new immutable candidate was installed, the prior selection bytes, selected slot, and rollback slot stay exact; the verified candidate remains installed so an identical retry can reuse it deterministically.
§Errors
Returns unsupported containment before archive or state access, rejects an absent or invalid prior selection, and propagates archive, admission, or atomic-publication failures.
Sourcepub fn disable(
&self,
) -> Result<OptionalParserPackLifecycleReport, OptionalParserPackLifecycleError>
pub fn disable( &self, ) -> Result<OptionalParserPackLifecycleReport, OptionalParserPackLifecycleError>
Disable the optional parser pack for the current project.
This cleanup remains supported and idempotent when containment is unsupported or the selection file is stale, malformed, or from another lifecycle schema.
§Errors
Returns only a filesystem cleanup or bounded status-inspection failure.
Sourcepub fn remove(
&self,
) -> Result<OptionalParserPackLifecycleReport, OptionalParserPackLifecycleError>
pub fn remove( &self, ) -> Result<OptionalParserPackLifecycleReport, OptionalParserPackLifecycleError>
Disable this project and remove this logical pack’s user-owned immutable slots.
Other projects are never scanned or mutated; their now-missing selections are reported as stale when they next inspect status. Cleanup is safe and idempotent on unsupported hosts.
§Errors
Returns only an exact lifecycle-owned filesystem cleanup or bounded status failure.
Sourcepub fn status(
&self,
) -> Result<OptionalParserPackLifecycleReport, OptionalParserPackLifecycleError>
pub fn status( &self, ) -> Result<OptionalParserPackLifecycleReport, OptionalParserPackLifecycleError>
Inspect bounded content-free lifecycle metadata without hashing or loading pack assets.
§Errors
Returns a filesystem error only when exact lifecycle-owned metadata cannot be inspected.
Sourcepub fn derive_project_selection(
&self,
) -> Result<OptionalParserPackProjectSelection, OptionalParserPackLifecycleError>
pub fn derive_project_selection( &self, ) -> Result<OptionalParserPackProjectSelection, OptionalParserPackLifecycleError>
Derive the current project’s content-free optional-parser selection.
An absent selection takes the default-core fast path without inspecting parser-pack storage. A present selection is rejected on unsupported hosts before its contents are read, then decoded through the strict lifecycle schema without opening any source file.
§Errors
Returns an unsafe project-state-path failure, typed unsupported containment for any present selection on an unsupported host, or a strict selection schema or identity failure.
Sourcepub fn resolve_selected_pack(
&self,
) -> Result<Option<VerifiedOptionalParserPackSelection>, OptionalParserPackLifecycleError>
pub fn resolve_selected_pack( &self, ) -> Result<Option<VerifiedOptionalParserPackSelection>, OptionalParserPackLifecycleError>
Resolve the current project’s enabled slot for normal runtime staging.
An absent selection returns Ok(None) on every host without inspecting pack storage.
A present selection refuses unsupported hosts before reading its contents. Supported
selections are returned only after immutable-slot, manifest, digest, and supervisor
admission verification.
§Errors
Returns typed unsupported containment for a present selection on an unsupported host, or a strict selection, slot, manifest, digest, immutability, or admission failure.
Trait Implementations§
Source§impl Clone for OptionalParserPackLifecycle
impl Clone for OptionalParserPackLifecycle
Source§fn clone(&self) -> OptionalParserPackLifecycle
fn clone(&self) -> OptionalParserPackLifecycle
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more