pub struct StepExecutor<T> { /* private fields */ }Expand description
Sequential executor that runs Steps in order, reporting progress and
honouring a CancellationToken.
Implementations§
Source§impl<T: Send + 'static> StepExecutor<T>
impl<T: Send + 'static> StepExecutor<T>
Sourcepub async fn execute(
&self,
input: T,
on_progress: impl Fn(StepStatus) + Send,
cancel: CancellationToken,
) -> AppResult<T>
pub async fn execute( &self, input: T, on_progress: impl Fn(StepStatus) + Send, cancel: CancellationToken, ) -> AppResult<T>
Run all steps sequentially.
- Each step receives the output of the previous step (or
inputfor the first). on_progressis called withStepStatus::StartedandStepStatus::Completed(orStepStatus::Failed) for every step.- If
cancelis triggered, the executor stops between steps and returnsErrorCode::Cancelled.
Auto Trait Implementations§
impl<T> !RefUnwindSafe for StepExecutor<T>
impl<T> !UnwindSafe for StepExecutor<T>
impl<T> Freeze for StepExecutor<T>
impl<T> Send for StepExecutor<T>
impl<T> Sync for StepExecutor<T>
impl<T> Unpin for StepExecutor<T>
impl<T> UnsafeUnpin for StepExecutor<T>
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