pub struct MatrixState { /* private fields */ }Expand description
State derives only from canonical snapshots; callers persist each mutation before effects.
Implementations§
Source§impl MatrixState
impl MatrixState
Sourcepub fn create(spec: MatrixSpec, root: &Path) -> MatrixResult<Self>
pub fn create(spec: MatrixSpec, root: &Path) -> MatrixResult<Self>
Create an idle matrix after structural and path validation.
Sourcepub fn from_snapshot(snapshot: MatrixSnapshot) -> MatrixResult<Self>
pub fn from_snapshot(snapshot: MatrixSnapshot) -> MatrixResult<Self>
Validate and restore a retained canonical checkpoint.
Sourcepub fn snapshot(&self) -> &MatrixSnapshot
pub fn snapshot(&self) -> &MatrixSnapshot
Inspect the complete canonical state.
Sourcepub fn event(&self) -> ThreadEvent
pub fn event(&self) -> ThreadEvent
Build the canonical event for an acknowledged persistence barrier.
Sourcepub fn active_assignments(&self) -> Vec<MatrixAssignment>
pub fn active_assignments(&self) -> Vec<MatrixAssignment>
Assignments whose owned work has not been confirmed stopped.
Sourcepub fn start(&mut self) -> MatrixResult<()>
pub fn start(&mut self) -> MatrixResult<()>
Freeze creation and permit scheduler dispatch.
Sourcepub fn pause(&mut self) -> MatrixResult<()>
pub fn pause(&mut self) -> MatrixResult<()>
Stop new dispatch while admitted workers finish.
Sourcepub fn resume(&mut self) -> MatrixResult<()>
pub fn resume(&mut self) -> MatrixResult<()>
Resume dispatch from a paused phase.
Sourcepub fn cancel(&mut self) -> MatrixResult<()>
pub fn cancel(&mut self) -> MatrixResult<()>
Permanently stop new dispatch; owned workers still require cleanup.
Sourcepub fn reserve_ready(
&mut self,
configured_cap: usize,
) -> MatrixResult<Vec<MatrixAssignment>>
pub fn reserve_ready( &mut self, configured_cap: usize, ) -> MatrixResult<Vec<MatrixAssignment>>
Reserve slot, shared workspace lease, and all named resources as one state mutation.
Sourcepub fn mark_launch_requested(&mut self, attempt_id: &str) -> MatrixResult<()>
pub fn mark_launch_requested(&mut self, attempt_id: &str) -> MatrixResult<()>
Persist this marker before invoking a process or worker launch.
Sourcepub fn rollback_launch(&mut self, attempt_id: &str) -> MatrixResult<()>
pub fn rollback_launch(&mut self, attempt_id: &str) -> MatrixResult<()>
Release a launch reservation after launch failure and confirmed cleanup.
Sourcepub fn report(
&mut self,
attempt_id: &str,
worker_id: &str,
outcome: MatrixOutcome,
evidence: Vec<MatrixCommandEvidence>,
cleanup_confirmed: bool,
) -> MatrixResult<()>
pub fn report( &mut self, attempt_id: &str, worker_id: &str, outcome: MatrixOutcome, evidence: Vec<MatrixCommandEvidence>, cleanup_confirmed: bool, ) -> MatrixResult<()>
Runtime must resolve evidence IDs to owned completed canonical commands before calling.
Sourcepub fn begin_verification(&mut self, generation: String) -> MatrixResult<()>
pub fn begin_verification(&mut self, generation: String) -> MatrixResult<()>
Start complete final verification after every execution task finishes.
Sourcepub fn finalize_verification(&mut self, generation: &str) -> MatrixResult<()>
pub fn finalize_verification(&mut self, generation: &str) -> MatrixResult<()>
The runtime fingerprints again after cleanup before committing success.
Sourcepub fn recover(&mut self) -> MatrixResult<()>
pub fn recover(&mut self) -> MatrixResult<()>
Explicit resume reconciles prepared assignments and blocks ambiguous survivors.
Sourcepub fn invalidate_verification(
&mut self,
generation: String,
) -> MatrixResult<()>
pub fn invalidate_verification( &mut self, generation: String, ) -> MatrixResult<()>
Invalidate every verification result after a source generation change.
Sourcepub fn retry(&mut self, task_id: &str) -> MatrixResult<()>
pub fn retry(&mut self, task_id: &str) -> MatrixResult<()>
Retry a failed task after an explicit coordinator decision and cleanup.
Sourcepub fn confirm_cleanup(
&mut self,
attempt_id: &str,
worker_id: &str,
) -> MatrixResult<()>
pub fn confirm_cleanup( &mut self, attempt_id: &str, worker_id: &str, ) -> MatrixResult<()>
Cleanup must be established by an ownership token, never a PID alone.