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) -> Result<&AgentConfig, AgentError>;
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 { ... }
}