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
impl GenerationLifecycle
Sourcepub fn status(&self) -> GenerationStatus
pub fn status(&self) -> GenerationStatus
Current state. Paused means all work and delivery at the boundary completed.
Sourcepub fn next_prediction(&self) -> u64
pub fn next_prediction(&self) -> u64
Next absolute prediction: zero is prefill, later values are decode.
Sourcepub fn finish_reason(&self) -> Option<FinishReason>
pub fn finish_reason(&self) -> Option<FinishReason>
Retained terminal outcome, including cancellation.
Sourcepub fn begin_prediction(&mut self) -> Result<(), ExecutionControlError>
pub fn begin_prediction(&mut self) -> Result<(), ExecutionControlError>
Enters one prediction. Call only after observing remote pause/cancel requests.
Sourcepub fn complete_prediction(
&mut self,
reason: Option<FinishReason>,
) -> Result<(), ExecutionControlError>
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.
Sourcepub fn pause(&mut self) -> Result<(), ExecutionControlError>
pub fn pause(&mut self) -> Result<(), ExecutionControlError>
Pauses an already quiescent session without advancing a prediction or RNG.
Sourcepub fn cancel(&mut self) -> Result<(), ExecutionControlError>
pub fn cancel(&mut self) -> Result<(), ExecutionControlError>
Cancels before the next prediction, after native work is known quiescent.
Sourcepub fn cancel_without_prediction(&mut self) -> Result<(), ExecutionControlError>
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.
Sourcepub fn fail(&mut self)
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.
Sourcepub fn checkpoint(&self) -> Result<GenerationBoundary, ExecutionControlError>
pub fn checkpoint(&self) -> Result<GenerationBoundary, ExecutionControlError>
Saves a quiescent initial, paused or normally completed boundary.
Sourcepub fn validate_restore(&self) -> Result<(), ExecutionControlError>
pub fn validate_restore(&self) -> Result<(), ExecutionControlError>
Validates the portable restore transition before native copying begins.
Sourcepub fn restore(
&mut self,
saved: &GenerationBoundary,
) -> Result<(), ExecutionControlError>
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.
Sourcepub fn fork(saved: &GenerationBoundary) -> Self
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.