Skip to main content

Checkpointer

Trait Checkpointer 

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

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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,

Delete all checkpoints for a thread.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§