Skip to main content

DatasetCheckpoint

Trait DatasetCheckpoint 

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

    // Required methods
    fn snapshot_dataset(&self) -> Self::State;
    fn validate_dataset_state(&self, state: &Self::State) -> Result<()>;
    fn restore_dataset_validated(&mut self, state: &Self::State);
}
Expand description

Dataset state used by exact serial loader checkpoints.

Validation must be read-only, and restore must be infallible after matching validation succeeds.

Required Associated Types§

Source

type State: Clone + Serialize + DeserializeOwned

Owned serializable dataset state.

Required Methods§

Source

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

Captures dataset state at the visible boundary.

Source

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

Checks state compatibility without mutation.

Source

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

Restores state accepted by Self::validate_dataset_state.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§