Skip to main content

CheckpointStore

Trait CheckpointStore 

Source
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§

Source

fn save(&self, checkpoint: Checkpoint<S>) -> Result<(), FoldError>
where S: Clone + Serialize,

Persist a checkpoint, computing and storing an integrity hash.

Source

fn load(&self, id: &str) -> Result<Option<Checkpoint<S>>, FoldError>
where S: Clone + Serialize,

Load a checkpoint by exact id, verifying the integrity hash.

Source

fn load_latest(&self, prefix: &str) -> Result<Option<Checkpoint<S>>, FoldError>
where S: Clone + Serialize,

Load the most recently created checkpoint whose id starts with prefix.

Source

fn delete(&self, id: &str) -> Result<(), FoldError>

Delete the checkpoint with the given id.

Source

fn list(&self) -> Result<Vec<String>, FoldError>

List all checkpoint id strings currently stored.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§