Skip to main content

CheckpointStore

Trait CheckpointStore 

Source
pub trait CheckpointStore: Send + Sync {
    // Required methods
    fn save<'life0, 'life1, 'async_trait>(
        &'life0 self,
        thread_id: &'life1 str,
        metadata: CheckpointMetadata,
        state: Vec<u8>,
    ) -> Pin<Box<dyn Future<Output = Result<CheckpointId, CheckpointError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn load<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        thread_id: &'life1 str,
        checkpoint_id: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<(CheckpointMetadata, Vec<u8>), CheckpointError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn load_latest<'life0, 'life1, 'async_trait>(
        &'life0 self,
        thread_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<(CheckpointMetadata, Vec<u8>), CheckpointError>> + 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<CheckpointMetadata>, CheckpointError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn delete<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        thread_id: &'life1 str,
        checkpoint_id: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), CheckpointError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn delete_thread<'life0, 'life1, 'async_trait>(
        &'life0 self,
        thread_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<(), CheckpointError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn count<'life0, 'life1, 'async_trait>(
        &'life0 self,
        thread_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<usize, CheckpointError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn list_threads<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<ThreadId>, CheckpointError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Trait for checkpoint storage backends

Required Methods§

Source

fn save<'life0, 'life1, 'async_trait>( &'life0 self, thread_id: &'life1 str, metadata: CheckpointMetadata, state: Vec<u8>, ) -> Pin<Box<dyn Future<Output = Result<CheckpointId, CheckpointError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Save a checkpoint, returns the checkpoint ID

Source

fn load<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, thread_id: &'life1 str, checkpoint_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<(CheckpointMetadata, Vec<u8>), CheckpointError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Load a specific checkpoint

Source

fn load_latest<'life0, 'life1, 'async_trait>( &'life0 self, thread_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(CheckpointMetadata, Vec<u8>), CheckpointError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Load the latest checkpoint for a thread

Source

fn list<'life0, 'life1, 'async_trait>( &'life0 self, thread_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<CheckpointMetadata>, CheckpointError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

List all checkpoints for a thread

Source

fn delete<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, thread_id: &'life1 str, checkpoint_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<(), CheckpointError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Delete a specific checkpoint

Source

fn delete_thread<'life0, 'life1, 'async_trait>( &'life0 self, thread_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<(), CheckpointError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Delete all checkpoints for a thread

Source

fn count<'life0, 'life1, 'async_trait>( &'life0 self, thread_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<usize, CheckpointError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get checkpoint count for a thread

Source

fn list_threads<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Vec<ThreadId>, CheckpointError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

List all threads with checkpoints

Implementors§