Skip to main content

Dispatcher

Trait Dispatcher 

Source
pub trait Dispatcher {
    // Required method
    fn dispatch(&self, ref_: &str, input: Value) -> Result<Value, EvalError>;
}
Expand description

Dispatcher callback: resolves a Step.ref against the provided input, returns the step’s raw output value.

Host crates (e.g. mlua-swarm-engine) provide concrete implementations: agent-block process spawn, mlua callback, MCP call, direct LLM, etc. Fn(&str, Value) -> Result<Value, EvalError> closures also implement this trait via the blanket impl below.

Required Methods§

Source

fn dispatch(&self, ref_: &str, input: Value) -> Result<Value, EvalError>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<F> Dispatcher for F
where F: Fn(&str, Value) -> Result<Value, EvalError>,