Agent

Trait Agent 

Source
pub trait Agent {
Show 14 methods // Required methods fn new( askit: ASKit, id: String, def_name: String, config: Option<AgentConfig>, ) -> Result<Self, AgentError> where Self: Sized; fn askit(&self) -> &ASKit; fn id(&self) -> &str; fn status(&self) -> &AgentStatus; fn def_name(&self) -> &str; fn config(&self) -> Option<&AgentConfig>; fn set_config(&mut self, config: AgentConfig) -> Result<(), AgentError>; fn flow_name(&self) -> &str; fn set_flow_name(&mut self, flow_name: String); 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: 'async_trait, 'life0: 'async_trait; // Provided methods fn get_global_config(&self) -> Option<AgentConfig> { ... } fn runtime(&self) -> &Runtime { ... }
}

Required Methods§

Source

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

Source

fn askit(&self) -> &ASKit

Source

fn id(&self) -> &str

Source

fn status(&self) -> &AgentStatus

Source

fn def_name(&self) -> &str

Source

fn config(&self) -> Option<&AgentConfig>

Source

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

Source

fn flow_name(&self) -> &str

Source

fn set_flow_name(&mut self, flow_name: String)

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: 'async_trait, 'life0: 'async_trait,

Provided Methods§

Implementors§

Source§

impl<T: AsAgent + Send + Sync> Agent for T