Skip to main content

CheckpointStore

Trait CheckpointStore 

Source
pub trait CheckpointStore: Send + Sync {
    // Required methods
    fn save_sync(&self, agent_key: &str, field: &str, value: Value);
    fn load_sync(&self, agent_key: &str, field: &str) -> Option<Value>;
    fn load_all_sync(&self, agent_key: &str) -> HashMap<String, Value>;
    fn save_all_sync(&self, agent_key: &str, fields: &HashMap<String, Value>);
    fn exists_sync(&self, agent_key: &str) -> bool;
}
Expand description

A checkpoint store for persisting agent state.

This is a re-export of the trait from sage-persistence, simplified for use in generated code.

Required Methods§

Source

fn save_sync(&self, agent_key: &str, field: &str, value: Value)

Save a field value synchronously (blocks on async).

Source

fn load_sync(&self, agent_key: &str, field: &str) -> Option<Value>

Load a field value synchronously.

Source

fn load_all_sync(&self, agent_key: &str) -> HashMap<String, Value>

Load all fields for an agent.

Source

fn save_all_sync(&self, agent_key: &str, fields: &HashMap<String, Value>)

Save all fields atomically.

Source

fn exists_sync(&self, agent_key: &str) -> bool

Check if any checkpoint exists for an agent.

Implementors§