Skip to main content

AgentStore

Trait AgentStore 

Source
pub trait AgentStore: Send + Sync {
    // Required methods
    fn insert<'life0, 'life1, 'async_trait>(
        &'life0 self,
        record: &'life1 AgentRecord,
    ) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get<'life0, 'life1, 'async_trait>(
        &'life0 self,
        agent_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<AgentRecord>, StorageError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn update_state<'life0, 'life1, 'async_trait>(
        &'life0 self,
        agent_id: &'life1 str,
        state: AgentState,
        terminal_reason: Option<TerminalReason>,
        state_changed_at: i64,
    ) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn set_checkpoint<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        agent_id: &'life1 str,
        checkpoint_session_id: &'life2 str,
        checkpoint_cursor: i64,
    ) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn find_by_idempotency<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        owner_actor: &'life1 str,
        idempotency_key: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<AgentRecord>, StorageError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn find_non_terminal_by_provider_session<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        provider: &'life1 str,
        provider_session_id: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<AgentRecord>, StorageError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn terminate_all_non_terminal<'life0, 'async_trait>(
        &'life0 self,
        state_changed_at: i64,
    ) -> Pin<Box<dyn Future<Output = Result<u64, StorageError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Durable storage for runtime-owned agent process records.

Required Methods§

Source

fn insert<'life0, 'life1, 'async_trait>( &'life0 self, record: &'life1 AgentRecord, ) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn get<'life0, 'life1, 'async_trait>( &'life0 self, agent_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<AgentRecord>, StorageError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn update_state<'life0, 'life1, 'async_trait>( &'life0 self, agent_id: &'life1 str, state: AgentState, terminal_reason: Option<TerminalReason>, state_changed_at: i64, ) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn set_checkpoint<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, agent_id: &'life1 str, checkpoint_session_id: &'life2 str, checkpoint_cursor: i64, ) -> Pin<Box<dyn Future<Output = Result<(), StorageError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn find_by_idempotency<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, owner_actor: &'life1 str, idempotency_key: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Option<AgentRecord>, StorageError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn find_non_terminal_by_provider_session<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, provider: &'life1 str, provider_session_id: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Option<AgentRecord>, StorageError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source

fn terminate_all_non_terminal<'life0, 'async_trait>( &'life0 self, state_changed_at: i64, ) -> Pin<Box<dyn Future<Output = Result<u64, StorageError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§