OptionalParserPackLifecycle

Struct OptionalParserPackLifecycle 

Source
pub struct OptionalParserPackLifecycle { /* private fields */ }
Expand description

Concrete owner of project selection and user-owned immutable pack slots.

Implementations§

Source§

impl OptionalParserPackLifecycle

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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

Source§

fn clone(&self) -> OptionalParserPackLifecycle

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for OptionalParserPackLifecycle

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.