Skip to main content

Checkpointer

Trait Checkpointer 

pub trait Checkpointer<R>: Send + Sync
where R: Checkpoint,
{ // Required methods fn save(&self, epoch: usize, record: R) -> Result<(), CheckpointerError>; fn delete(&self, epoch: usize) -> Result<(), CheckpointerError>; fn restore(&self, epoch: usize) -> Result<R, CheckpointerError>; }
Expand description

The trait for checkpointer.

Required Methods§

fn save(&self, epoch: usize, record: R) -> Result<(), CheckpointerError>

Save the record.

§Arguments
  • epoch - The epoch.
  • record - The record.

fn delete(&self, epoch: usize) -> Result<(), CheckpointerError>

Delete the checkpoint saved at the given epoch if present.

fn restore(&self, epoch: usize) -> Result<R, CheckpointerError>

Restore the record from the checkpoint saved at the given epoch.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

§

impl<R> Checkpointer<R> for AsyncCheckpointer<R>
where R: Checkpoint,

§

impl<R> Checkpointer<R> for FileCheckpointer
where R: Checkpoint,