AsAgent

Trait AsAgent 

Source
pub trait AsAgent {
    // Required methods
    fn new(
        askit: ASKit,
        id: String,
        def_name: String,
        config: Option<AgentConfig>,
    ) -> Result<Self, AgentError>
       where Self: Sized + Send + Sync;
    fn data(&self) -> &AsAgentData;
    fn mut_data(&mut self) -> &mut AsAgentData;

    // Provided methods
    fn set_config(&mut self, _config: AgentConfig) -> Result<(), AgentError> { ... }
    fn start(&mut self) -> Result<(), AgentError> { ... }
    fn stop(&mut self) -> Result<(), AgentError> { ... }
    fn process<'life0, 'async_trait>(
        &'life0 mut self,
        _ctx: AgentContext,
        _data: AgentData,
    ) -> Pin<Box<dyn Future<Output = Result<(), AgentError>> + Send + 'async_trait>>
       where Self: Send + 'async_trait,
             'life0: 'async_trait { ... }
}

Required Methods§

Source

fn new( askit: ASKit, id: String, def_name: String, config: Option<AgentConfig>, ) -> Result<Self, AgentError>
where Self: Sized + Send + Sync,

Source

fn data(&self) -> &AsAgentData

Source

fn mut_data(&mut self) -> &mut AsAgentData

Provided Methods§

Source

fn set_config(&mut self, _config: AgentConfig) -> Result<(), AgentError>

Source

fn start(&mut self) -> Result<(), AgentError>

Source

fn stop(&mut self) -> Result<(), AgentError>

Source

fn process<'life0, 'async_trait>( &'life0 mut self, _ctx: AgentContext, _data: AgentData, ) -> Pin<Box<dyn Future<Output = Result<(), AgentError>> + Send + 'async_trait>>
where Self: Send + 'async_trait, 'life0: 'async_trait,

Implementors§