Checkpoint

Trait Checkpoint 

Source
pub trait Checkpoint{
    // Provided methods
    fn checkpoint_name() -> String { ... }
    fn from_checkpoint_n(db: &DbConnection, n: i32) -> Result<Self> { ... }
    fn commit_checkpoint(&self, db: &DbConnection) -> Result<()> { ... }
    fn restore_from_checkpoint(&mut self, db: &DbConnection) -> Result<()> { ... }
    fn get_number_of_checkpoints(db: &DbConnection) -> Result<u64> { ... }
    fn restore_from_checkpoint_n(
        &mut self,
        db: &DbConnection,
        n: i32,
    ) -> Result<()> { ... }
}

Provided Methods§

Source

fn checkpoint_name() -> String

Return an unique name as the container for your data.

Source

fn from_checkpoint_n(db: &DbConnection, n: i32) -> Result<Self>

Load from the specified checkpoint n (ordered by create time).

Source

fn commit_checkpoint(&self, db: &DbConnection) -> Result<()>

Set a checkpoint

Source

fn restore_from_checkpoint(&mut self, db: &DbConnection) -> Result<()>

Restore state from the latest checkpoint.

Source

fn get_number_of_checkpoints(db: &DbConnection) -> Result<u64>

Return the number of available checkpoints in database.

Source

fn restore_from_checkpoint_n(&mut self, db: &DbConnection, n: i32) -> Result<()>

Restore state from the specified checkpoint n (ordered by create time).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§