pub trait Checkpointer: Send + Sync {
// Required methods
fn save<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
checkpoint_id: &'life2 str,
data: &'life3 [u8],
meta: &'life4 CheckpointMeta,
) -> Pin<Box<dyn Future<Output = Result<(), PeError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait;
fn load_latest<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<(Vec<u8>, CheckpointMeta)>, PeError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn load_by_id<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
checkpoint_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, PeError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn list<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<CheckpointMeta>, PeError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn put_writes<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
checkpoint_id: &'life2 str,
writes: &'life3 [PendingWrite],
) -> Pin<Box<dyn Future<Output = Result<(), PeError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
fn delete_thread<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), PeError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
Storage-agnostic checkpoint persistence.
Implementations store opaque bytes — the engine handles serialization. All methods are async to support network-backed stores.
Required Methods§
Sourcefn save<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
checkpoint_id: &'life2 str,
data: &'life3 [u8],
meta: &'life4 CheckpointMeta,
) -> Pin<Box<dyn Future<Output = Result<(), PeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn save<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
checkpoint_id: &'life2 str,
data: &'life3 [u8],
meta: &'life4 CheckpointMeta,
) -> Pin<Box<dyn Future<Output = Result<(), PeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Save a checkpoint. Returns nothing on success.
Sourcefn load_latest<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<(Vec<u8>, CheckpointMeta)>, PeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_latest<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<(Vec<u8>, CheckpointMeta)>, PeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Load the most recent checkpoint for a thread.
Sourcefn load_by_id<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
checkpoint_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, PeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn load_by_id<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
checkpoint_id: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, PeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Load a specific checkpoint by ID.
Sourcefn list<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<CheckpointMeta>, PeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list<'life0, 'life1, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Vec<CheckpointMeta>, PeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
List all checkpoints for a thread, oldest first.
Sourcefn put_writes<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
checkpoint_id: &'life2 str,
writes: &'life3 [PendingWrite],
) -> Pin<Box<dyn Future<Output = Result<(), PeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn put_writes<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
thread_id: &'life1 str,
checkpoint_id: &'life2 str,
writes: &'life3 [PendingWrite],
) -> Pin<Box<dyn Future<Output = Result<(), PeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Store pending writes alongside a checkpoint.
Not yet called by the engine. The BSP loop tracks PendingWrites
internally but does not persist them via this method yet. Plan 006
(RetryPolicy) will activate this — failed nodes can be retried while
successful nodes’ writes are loaded from the checkpointer instead of
re-executing. Implementors should store writes keyed by checkpoint_id.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".