Skip to main content

SnapshotStore

Trait SnapshotStore 

Source
pub trait SnapshotStore:
    Send
    + Sync
    + 'static {
    // Required methods
    fn save<'life0, 'life1, 'async_trait>(
        &'life0 self,
        snapshot: &'life1 Snapshot,
    ) -> Pin<Box<dyn Future<Output = Result<(), RuntimeError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             'life1: 'async_trait,
             Self: 'async_trait;
    fn load<'life0, 'async_trait>(
        &'life0 self,
        run_id: RunId,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Snapshot>, RuntimeError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn delete<'life0, 'async_trait>(
        &'life0 self,
        run_id: RunId,
    ) -> Pin<Box<dyn Future<Output = Result<(), RuntimeError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
    fn list<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<Snapshot>, RuntimeError>> + Send + 'async_trait>>
       where 'life0: 'async_trait,
             Self: 'async_trait;
}
Expand description

Trait for snapshot persistence backends.

Required Methods§

Source

fn save<'life0, 'life1, 'async_trait>( &'life0 self, snapshot: &'life1 Snapshot, ) -> Pin<Box<dyn Future<Output = Result<(), RuntimeError>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, Self: 'async_trait,

Saves a snapshot.

§Errors

Returns RuntimeError if serialization or disk I/O fails.

Source

fn load<'life0, 'async_trait>( &'life0 self, run_id: RunId, ) -> Pin<Box<dyn Future<Output = Result<Option<Snapshot>, RuntimeError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Loads a snapshot by run ID.

§Errors

Returns RuntimeError if disk I/O or deserialization fails.

Source

fn delete<'life0, 'async_trait>( &'life0 self, run_id: RunId, ) -> Pin<Box<dyn Future<Output = Result<(), RuntimeError>> + Send + 'async_trait>>
where 'life0: 'async_trait, Self: 'async_trait,

Deletes a snapshot by run ID.

§Errors

Returns RuntimeError if I/O fails.

Source

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

Lists all active snapshots.

§Errors

Returns RuntimeError if directory reading fails.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§