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§
Sourcefn checkpoint_name() -> String
fn checkpoint_name() -> String
Return an unique name as the container for your data.
Sourcefn from_checkpoint_n(db: &DbConnection, n: i32) -> Result<Self>
fn from_checkpoint_n(db: &DbConnection, n: i32) -> Result<Self>
Load from the specified checkpoint n (ordered by create time).
Sourcefn commit_checkpoint(&self, db: &DbConnection) -> Result<()>
fn commit_checkpoint(&self, db: &DbConnection) -> Result<()>
Set a checkpoint
Sourcefn restore_from_checkpoint(&mut self, db: &DbConnection) -> Result<()>
fn restore_from_checkpoint(&mut self, db: &DbConnection) -> Result<()>
Restore state from the latest checkpoint.
Sourcefn get_number_of_checkpoints(db: &DbConnection) -> Result<u64>
fn get_number_of_checkpoints(db: &DbConnection) -> Result<u64>
Return the number of available checkpoints in database.
Sourcefn restore_from_checkpoint_n(&mut self, db: &DbConnection, n: i32) -> Result<()>
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.