pub struct Runner<S: Clone + 'static> { /* private fields */ }Expand description
Executes a Workflow step by step, handling retries, waits, and routing.
Implementations§
Source§impl<S: Clone + 'static> Runner<S>
impl<S: Clone + 'static> Runner<S>
Sourcepub fn new(wf: Workflow<S>) -> Self
pub fn new(wf: Workflow<S>) -> Self
Create a runner for the given workflow with default limits (max_steps: 10,000, max_retries: 3).
Sourcepub fn with_max_steps(self, max_steps: usize) -> Self
pub fn with_max_steps(self, max_steps: usize) -> Self
Prevent accidental infinite loops.
Sourcepub fn with_max_retries(self, max_retries: usize) -> Self
pub fn with_max_retries(self, max_retries: usize) -> Self
Set the maximum consecutive retries per agent before failing.
Sourcepub fn on_step(self, cb: impl FnMut(&StepEvent<'_>) + 'static) -> Self
pub fn on_step(self, cb: impl FnMut(&StepEvent<'_>) + 'static) -> Self
Register a callback that fires after each successful agent step.
Sourcepub fn on_error(self, cb: impl FnMut(&ErrorEvent<'_>) + 'static) -> Self
pub fn on_error(self, cb: impl FnMut(&ErrorEvent<'_>) + 'static) -> Self
Register a callback that fires when an agent errors or a limit is exceeded.
Sourcepub fn with_tracing(self) -> Self
pub fn with_tracing(self) -> Self
Set both hooks to print step transitions and errors to stderr.
Auto Trait Implementations§
impl<S> Freeze for Runner<S>
impl<S> !RefUnwindSafe for Runner<S>
impl<S> !Send for Runner<S>
impl<S> !Sync for Runner<S>
impl<S> Unpin for Runner<S>
impl<S> UnsafeUnpin for Runner<S>
impl<S> !UnwindSafe for Runner<S>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more