pub trait Agent<S>: Send + 'static {
// Required methods
fn name(&self) -> &'static str;
fn run(&mut self, state: S, ctx: &mut Ctx) -> StepResult<S>;
}Expand description
A sync agent that transforms state one step at a time.
Implement this trait on your own structs and register them into a
crate::Workflow to build a pipeline.
Required Methods§
Sourcefn name(&self) -> &'static str
fn name(&self) -> &'static str
A unique name for this agent, used for routing with Outcome::Next.
Sourcefn run(&mut self, state: S, ctx: &mut Ctx) -> StepResult<S>
fn run(&mut self, state: S, ctx: &mut Ctx) -> StepResult<S>
Run one step. Returns the updated state and an Outcome that tells
the runner what to do next.