Skip to main content

AgentStore

Trait AgentStore 

Source
pub trait AgentStore: Send + Sync {
    // Required method
    fn get_agent<'life0, 'async_trait>(
        &'life0 self,
        agent_id: AgentId,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Agent>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Trait for retrieving agent configurations

Implementations can:

  • Load agents from a database
  • Keep agents in memory for testing
  • Load agents from a configuration file

Required Methods§

Source

fn get_agent<'life0, 'async_trait>( &'life0 self, agent_id: AgentId, ) -> Pin<Box<dyn Future<Output = Result<Option<Agent>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get an agent by ID

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<T: AgentStore + ?Sized> AgentStore for Arc<T>

Source§

fn get_agent<'life0, 'async_trait>( &'life0 self, agent_id: AgentId, ) -> Pin<Box<dyn Future<Output = Result<Option<Agent>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§