pub struct Workflow<Start, Current, Backend, T = Identity> { /* private fields */ }Expand description
A workflow represents a sequence of steps to be executed in order.
Implementations§
Source§impl<Start, Cur, B, L> Workflow<Start, Cur, B, L>where
B: BackendExt,
impl<Start, Cur, B, L> Workflow<Start, Cur, B, L>where
B: BackendExt,
Sourcepub fn and_then<F, O, FnArgs>(
self,
and_then: F,
) -> Workflow<Start, O, B, Stack<AndThen<TaskFn<F, Cur, B::Context, FnArgs>>, L>>
pub fn and_then<F, O, FnArgs>( self, and_then: F, ) -> Workflow<Start, O, B, Stack<AndThen<TaskFn<F, Cur, B::Context, FnArgs>>, L>>
Adds a transformation step to the workflow that processes the output of the previous step.
The and_then method allows you to chain operations by providing a function that
takes the result of the current workflow step and transforms it into the input
for the next step. This enables building complex processing pipelines with
type-safe transformations between steps.
§Example
workflow
.and_then(extract)
.and_then(transform)
.and_then(load);Source§impl<Start, Cur, B, L> Workflow<Start, Cur, B, L>
impl<Start, Cur, B, L> Workflow<Start, Cur, B, L>
Sourcepub fn delay_with<F, I>(
self,
f: F,
) -> Workflow<Start, I, B, Stack<DelayWith<F, B, I>, L>>
pub fn delay_with<F, I>( self, f: F, ) -> Workflow<Start, I, B, Stack<DelayWith<F, B, I>, L>>
Delay the workflow by a duration determined by a function
Source§impl<Start, C, L, I: IntoIterator<Item = C>, B: BackendExt> Workflow<Start, I, B, L>
impl<Start, C, L, I: IntoIterator<Item = C>, B: BackendExt> Workflow<Start, I, B, L>
Source§impl<Start, C, L, I: IntoIterator<Item = C>, B: BackendExt> Workflow<Start, I, B, L>
impl<Start, C, L, I: IntoIterator<Item = C>, B: BackendExt> Workflow<Start, I, B, L>
Source§impl<Start, L, Input, B: BackendExt> Workflow<Start, Input, B, L>
impl<Start, L, Input, B: BackendExt> Workflow<Start, Input, B, L>
Sourcepub fn repeat_until<F, Output, FnArgs>(
self,
repeater: F,
) -> Workflow<Start, Output, B, Stack<RepeatUntil<TaskFn<F, Input, B::Context, FnArgs>, Input, Output>, L>>
pub fn repeat_until<F, Output, FnArgs>( self, repeater: F, ) -> Workflow<Start, Output, B, Stack<RepeatUntil<TaskFn<F, Input, B::Context, FnArgs>, Input, Output>, L>>
Folds over a collection of items in the workflow.
Source§impl<Start, Cur, B, L> Workflow<Start, Cur, B, L>
impl<Start, Cur, B, L> Workflow<Start, Cur, B, L>
Sourcepub fn add_step<S, Output>(
self,
step: S,
) -> Workflow<Start, Output, B, Stack<S, L>>
pub fn add_step<S, Output>( self, step: S, ) -> Workflow<Start, Output, B, Stack<S, L>>
Adds a new step to the workflow pipeline.
This method should be used with caution, as it allows adding arbitrary steps and manipulating types. It is recommended to use higher-level abstractions for common workflow patterns.