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§
Sourcefn save<'a>(
&'a self,
snapshot: &'a AgentSnapshot,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'a>>
fn save<'a>( &'a self, snapshot: &'a AgentSnapshot, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'a>>
Persist a snapshot.
Sourcefn load<'a>(
&'a self,
agent_id: &'a str,
) -> Pin<Box<dyn Future<Output = Result<Option<AgentSnapshot>>> + Send + 'a>>
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.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".