Skip to main content

Checkpointer

Trait Checkpointer 

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

The trait for checkpointer.

Required Methods§

Source

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

Save the record.

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

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

Delete the record at the given epoch if present.

Source

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

Restore the record.

§Arguments
  • epoch - The epoch.
  • device - The device used to restore the record.
§Returns

The record.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§

Source§

impl<FR, R, B> Checkpointer<R, B> for FileCheckpointer<FR>
where R: Record<B>, FR: FileRecorder<B>, B: Backend,

Source§

impl<R, B> Checkpointer<R, B> for AsyncCheckpointer<R, B>
where R: Record<B> + 'static, B: Backend,