pub trait CheckpointStore: Send + Sync {
// Required methods
fn store_checkpoint<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 CheckpointID,
checkpoint_data: String,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn read_checkpoint<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 CheckpointID,
) -> Pin<Box<dyn Future<Output = Result<Option<StoredCheckpoint>, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
}Expand description
Trait for checkpoint storage operations.
This trait abstracts the storage backend for checkpoint operations, allowing the same checkpoint logic to work with:
- Filesystem storage (
FilesystemStore) - SurrealDB v2 (
Surreal2Store) - SurrealDB v3 (
Surreal3Storebehindsurreal-sync-surrealfeaturev3)
Required Methods§
Sourcefn store_checkpoint<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 CheckpointID,
checkpoint_data: String,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn store_checkpoint<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 CheckpointID,
checkpoint_data: String,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Store a checkpoint in the storage backend.
Sourcefn read_checkpoint<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 CheckpointID,
) -> Pin<Box<dyn Future<Output = Result<Option<StoredCheckpoint>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn read_checkpoint<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 CheckpointID,
) -> Pin<Box<dyn Future<Output = Result<Option<StoredCheckpoint>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Read a checkpoint from the storage backend.
Returns None if the checkpoint doesn’t exist.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".