pub trait CheckpointStore<S> {
// Required methods
fn save(&self, checkpoint: Checkpoint<S>) -> Result<(), FoldError>
where S: Clone + Serialize;
fn load(&self, id: &str) -> Result<Option<Checkpoint<S>>, FoldError>
where S: Clone + Serialize;
fn load_latest(
&self,
prefix: &str,
) -> Result<Option<Checkpoint<S>>, FoldError>
where S: Clone + Serialize;
fn delete(&self, id: &str) -> Result<(), FoldError>;
fn list(&self) -> Result<Vec<String>, FoldError>;
}Expand description
Trait for checkpoint persistence backends.
Required Methods§
Sourcefn save(&self, checkpoint: Checkpoint<S>) -> Result<(), FoldError>
fn save(&self, checkpoint: Checkpoint<S>) -> Result<(), FoldError>
Persist a checkpoint, computing and storing an integrity hash.
Sourcefn load(&self, id: &str) -> Result<Option<Checkpoint<S>>, FoldError>
fn load(&self, id: &str) -> Result<Option<Checkpoint<S>>, FoldError>
Load a checkpoint by exact id, verifying the integrity hash.
Sourcefn load_latest(&self, prefix: &str) -> Result<Option<Checkpoint<S>>, FoldError>
fn load_latest(&self, prefix: &str) -> Result<Option<Checkpoint<S>>, FoldError>
Load the most recently created checkpoint whose id starts with prefix.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".