use std::future::Future;
use std::io;
use std::pin::Pin;
use super::Checkpoint;
pub type CheckpointFuture<'a, T> = Pin<Box<dyn Future<Output = io::Result<T>> + Send + 'a>>;
pub trait CheckpointStore: Send + Sync {
fn save_checkpoint(&self, checkpoint: Checkpoint) -> CheckpointFuture<'_, ()>;
fn load_checkpoint(&self, id: &str) -> CheckpointFuture<'_, Option<Checkpoint>>;
fn list_checkpoints(&self) -> CheckpointFuture<'_, Vec<String>>;
fn delete_checkpoint(&self, id: &str) -> CheckpointFuture<'_, ()>;
}
#[cfg(test)]
#[path = "store_tests.rs"]
mod tests;