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§
Sourcetype State: Clone + Serialize + DeserializeOwned
type State: Clone + Serialize + DeserializeOwned
Owned serializable transform state.
Required Methods§
Sourcefn validate_snapshot(&self, state: &Self::State) -> Result<()>
fn validate_snapshot(&self, state: &Self::State) -> Result<()>
Checks state compatibility without mutation.
Sourcefn restore_validated(&mut self, state: &Self::State)
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".