Skip to main content

WorkerCheckpoint

Trait WorkerCheckpoint 

Source
pub trait WorkerCheckpoint {
    type State: Clone + Serialize + DeserializeOwned;

    // Required methods
    fn snapshot(&self) -> Self::State;
    fn validate_snapshot(&self, state: &Self::State) -> Result<()>;
    fn restore_validated(&mut self, state: &Self::State);
}
Expand description

Checkpoint contract for one transform instance.

Serial checkpoints capture one instance; worker barriers restore each deterministic lane to its first unconsumed task.

Required Associated Types§

Source

type State: Clone + Serialize + DeserializeOwned

Owned serializable transform state.

Required Methods§

Source

fn snapshot(&self) -> Self::State

Captures current transform state.

Source

fn validate_snapshot(&self, state: &Self::State) -> Result<()>

Checks state compatibility without mutation.

Source

fn restore_validated(&mut self, state: &Self::State)

Restores state accepted by Self::validate_snapshot.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§