pub struct ConcurrentWorkflowBuilder<TState, TStore = MemoryStore, TParams = DefaultTaskParams>where
TState: Clone + Debug + Hash + Eq + Send + Sync + 'static,
TParams: Clone + Send + Sync + 'static,
TStore: Clone + Send + Sync + 'static,{ /* private fields */ }Expand description
Builder for creating ConcurrentWorkflow instances with a fluent API
Implementations§
Source§impl<TState, TStore, TParams> ConcurrentWorkflowBuilder<TState, TStore, TParams>
impl<TState, TStore, TParams> ConcurrentWorkflowBuilder<TState, TStore, TParams>
Sourcepub fn new(start_state: TState) -> Self
pub fn new(start_state: TState) -> Self
Create a new ConcurrentWorkflowBuilder with a starting state
Sourcepub fn register<T>(self, state: TState, task: T) -> Self
pub fn register<T>(self, state: TState, task: T) -> Self
Register a cloneable task for concurrent execution
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 cloneable node for concurrent execution
§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
Sourcepub fn build(self) -> ConcurrentWorkflow<TState, TStore, TParams>
pub fn build(self) -> ConcurrentWorkflow<TState, TStore, TParams>
Build the final ConcurrentWorkflow instance
Auto Trait Implementations§
impl<TState, TStore, TParams> Freeze for ConcurrentWorkflowBuilder<TState, TStore, TParams>where
TState: Freeze,
impl<TState, TStore = MemoryStore, TParams = HashMap<String, String>> !RefUnwindSafe for ConcurrentWorkflowBuilder<TState, TStore, TParams>
impl<TState, TStore, TParams> Send for ConcurrentWorkflowBuilder<TState, TStore, TParams>
impl<TState, TStore, TParams> Sync for ConcurrentWorkflowBuilder<TState, TStore, TParams>
impl<TState, TStore, TParams> Unpin for ConcurrentWorkflowBuilder<TState, TStore, TParams>where
TState: Unpin,
impl<TState, TStore = MemoryStore, TParams = HashMap<String, String>> !UnwindSafe for ConcurrentWorkflowBuilder<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