pub struct WorkflowBuilder<TState, TStore = MemoryStore, TParams = DefaultTaskParams>where
TState: Clone + Debug + Hash + Eq + Send + Sync + 'static,
TParams: Clone + Send + Sync + 'static,
TStore: Send + Sync + 'static,{ /* private fields */ }Expand description
Builder for creating Workflow instances with a fluent API
Provides a convenient way to construct flows with method chaining.
Implementations§
Source§impl<TState, TStore, TParams> WorkflowBuilder<TState, TStore, TParams>
impl<TState, TStore, TParams> WorkflowBuilder<TState, TStore, TParams>
Sourcepub fn register<T>(self, state: TState, task: T) -> Self
pub fn register<T>(self, state: TState, task: T) -> Self
Register a task for a state (accepts any type implementing Task<TState>)
Sourcepub fn register_node<T>(self, state: TState, task: T) -> Self
👎Deprecated since 0.5.0: Use register instead. The unified register method accepts both Tasks and Nodes.
pub fn register_node<T>(self, state: TState, task: T) -> Self
register instead. The unified register method accepts both Tasks and Nodes.Register a node for a state
§Deprecated
This method is deprecated. Use register instead.
The unified register method accepts both Tasks and Nodes and provides
the same functionality with a cleaner API.
§Example
ⓘ
// Instead of:
builder.register_node(state, my_node);
// Use:
builder.register(state, my_node);Sourcepub fn add_exit_state(self, state: TState) -> Self
pub fn add_exit_state(self, state: TState) -> Self
Add an exit state
Sourcepub fn add_exit_states(self, states: Vec<TState>) -> Self
pub fn add_exit_states(self, states: Vec<TState>) -> Self
Add multiple exit states
Auto Trait Implementations§
impl<TState, TStore, TParams> Freeze for WorkflowBuilder<TState, TStore, TParams>where
TState: Freeze,
impl<TState, TStore = MemoryStore, TParams = HashMap<String, String>> !RefUnwindSafe for WorkflowBuilder<TState, TStore, TParams>
impl<TState, TStore, TParams> Send for WorkflowBuilder<TState, TStore, TParams>
impl<TState, TStore, TParams> Sync for WorkflowBuilder<TState, TStore, TParams>
impl<TState, TStore, TParams> Unpin for WorkflowBuilder<TState, TStore, TParams>where
TState: Unpin,
impl<TState, TStore = MemoryStore, TParams = HashMap<String, String>> !UnwindSafe for WorkflowBuilder<TState, TStore, TParams>
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