pub trait CheckpointSaver:
Send
+ Sync
+ 'static {
// Required methods
fn get_tuple<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 RunnableConfig,
) -> Pin<Box<dyn Future<Output = Result<Option<CheckpointTuple>, CheckpointError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn list<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 RunnableConfig,
filter: Option<CheckpointFilter>,
) -> Pin<Box<dyn Future<Output = Result<Vec<CheckpointTuple>, CheckpointError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn put<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 RunnableConfig,
checkpoint: Checkpoint,
metadata: CheckpointMetadata,
) -> Pin<Box<dyn Future<Output = Result<RunnableConfig, CheckpointError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn put_writes<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
config: &'life1 RunnableConfig,
writes: Vec<PendingWrite>,
task_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), CheckpointError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait;
}Expand description
Checkpoint persistence interface
Trait defining operations for saving, loading, and listing checkpoints.
This trait is implemented by storage backends in the juncture-checkpoint crate.
§Example
ⓘ
use juncture_core::CheckpointSaver;
use juncture_checkpoint::MemorySaver;
let saver = MemorySaver::new();
// Use saver as a CheckpointSaver trait object...Required Methods§
Sourcefn get_tuple<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 RunnableConfig,
) -> Pin<Box<dyn Future<Output = Result<Option<CheckpointTuple>, CheckpointError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn get_tuple<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 RunnableConfig,
) -> Pin<Box<dyn Future<Output = Result<Option<CheckpointTuple>, CheckpointError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Sourcefn list<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 RunnableConfig,
filter: Option<CheckpointFilter>,
) -> Pin<Box<dyn Future<Output = Result<Vec<CheckpointTuple>, CheckpointError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn list<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 RunnableConfig,
filter: Option<CheckpointFilter>,
) -> Pin<Box<dyn Future<Output = Result<Vec<CheckpointTuple>, CheckpointError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Sourcefn put<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 RunnableConfig,
checkpoint: Checkpoint,
metadata: CheckpointMetadata,
) -> Pin<Box<dyn Future<Output = Result<RunnableConfig, CheckpointError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn put<'life0, 'life1, 'async_trait>(
&'life0 self,
config: &'life1 RunnableConfig,
checkpoint: Checkpoint,
metadata: CheckpointMetadata,
) -> Pin<Box<dyn Future<Output = Result<RunnableConfig, CheckpointError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Sourcefn put_writes<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
config: &'life1 RunnableConfig,
writes: Vec<PendingWrite>,
task_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), CheckpointError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn put_writes<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
config: &'life1 RunnableConfig,
writes: Vec<PendingWrite>,
task_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), CheckpointError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".