crb_agent/performers/
events_performer.rs

1use crate::agent::Agent;
2use crate::context::Context;
3use crate::performers::{Next, StatePerformer, Transition, TransitionCommand};
4use async_trait::async_trait;
5
6impl<A> Next<A>
7where
8    A: Agent,
9{
10    pub fn events() -> Self {
11        Self::new(EventsPerformer)
12    }
13}
14
15pub struct EventsPerformer;
16
17#[async_trait]
18impl<A> StatePerformer<A> for EventsPerformer
19where
20    A: Agent,
21{
22    async fn perform(&mut self, agent: A, _session: &mut Context<A>) -> Transition<A> {
23        let command = TransitionCommand::ProcessEvents;
24        Transition::Continue { agent, command }
25    }
26}