Skip to main content

SnapshotStore

Trait SnapshotStore 

Source
pub trait SnapshotStore: Send + Sync {
    // Required methods
    fn save<'a>(
        &'a self,
        snapshot: &'a AgentSnapshot,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'a>>;
    fn load<'a>(
        &'a self,
        agent_id: &'a str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<AgentSnapshot>>> + Send + 'a>>;
    fn list(
        &self,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + '_>>;
    fn delete<'a>(
        &'a self,
        agent_id: &'a str,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'a>>;
}
Expand description

Trait for persisting and retrieving agent snapshots.

Implementations may store to filesystem, database, or network.

Required Methods§

Source

fn save<'a>( &'a self, snapshot: &'a AgentSnapshot, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'a>>

Persist a snapshot.

Source

fn load<'a>( &'a self, agent_id: &'a str, ) -> Pin<Box<dyn Future<Output = Result<Option<AgentSnapshot>>> + Send + 'a>>

Retrieve a snapshot by agent ID.

Source

fn list(&self) -> Pin<Box<dyn Future<Output = Result<Vec<String>>> + Send + '_>>

List all agent IDs with stored snapshots.

Source

fn delete<'a>( &'a self, agent_id: &'a str, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'a>>

Delete a snapshot by agent ID.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§