pub trait RunnableAgent:
Send
+ Sync
+ 'static
+ Debug {
// Required methods
fn name(&self) -> &'static str;
fn description(&self) -> &'static str;
fn id(&self) -> Uuid;
fn run<'async_trait>(
self: Arc<Self>,
task: Task,
tx_event: Sender<Event>,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait;
fn memory(&self) -> Option<Arc<RwLock<Box<dyn MemoryProvider>>>>;
// Provided method
fn spawn_task(
self: Arc<Self>,
task: Task,
tx_event: Sender<Event>,
) -> JoinHandle<Result<(), Error>> { ... }
}Expand description
Trait for agents that can be executed within the system