Skip to main content

GenerationLifecycle

Struct GenerationLifecycle 

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

One portable lifecycle shared by all native implementations. A Running state includes native completion and record delivery, not just host submission.

Implementations§

Source§

impl GenerationLifecycle

Source

pub fn status(&self) -> GenerationStatus

Current state. Paused means all work and delivery at the boundary completed.

Source

pub fn next_prediction(&self) -> u64

Next absolute prediction: zero is prefill, later values are decode.

Source

pub fn epoch(&self) -> u64

Monotone restore epoch for consumer reconciliation. Never rewound.

Source

pub fn finish_reason(&self) -> Option<FinishReason>

Retained terminal outcome, including cancellation.

Source

pub fn begin_prediction(&mut self) -> Result<(), ExecutionControlError>

Enters one prediction. Call only after observing remote pause/cancel requests.

Source

pub fn complete_prediction( &mut self, reason: Option<FinishReason>, ) -> Result<(), ExecutionControlError>

Commits one prediction only after exact native completion, semantic commitment and associated capture/intervention record delivery succeed.

Source

pub fn pause(&mut self) -> Result<(), ExecutionControlError>

Pauses an already quiescent session without advancing a prediction or RNG.

Source

pub fn cancel(&mut self) -> Result<(), ExecutionControlError>

Cancels before the next prediction, after native work is known quiescent.

Source

pub fn cancel_without_prediction(&mut self) -> Result<(), ExecutionControlError>

Completes a cancellation observed after entering Running but before the ordinary cursor submitted or committed any prediction. Call only after verifying a quiescent native boundary; this never increments position.

Source

pub fn fail(&mut self)

Fences generation after an unresolved native or semantic/delivery failure. Failure does not imply native completion; the existing native owner survives.

Source

pub fn checkpoint(&self) -> Result<GenerationBoundary, ExecutionControlError>

Saves a quiescent initial, paused or normally completed boundary.

Source

pub fn validate_restore(&self) -> Result<(), ExecutionControlError>

Validates the portable restore transition before native copying begins.

Source

pub fn restore( &mut self, saved: &GenerationBoundary, ) -> Result<(), ExecutionControlError>

Installs the saved boundary after compatibility checks and atomic native restoration. A completed snapshot remains terminal; an earlier snapshot can resume an otherwise completed run. Cancellation and failure stay fenced.

Source

pub fn fork(saved: &GenerationBoundary) -> Self

Creates child lifecycle state at the same absolute position with epoch zero. Native state and immutable admissions must be independently forked/rebound.

Trait Implementations§

Source§

impl Debug for GenerationLifecycle

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for GenerationLifecycle

Source§

fn default() -> Self

Returns the “default value” for a type. 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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.