ConcurrentWorkflowBuilder

Struct ConcurrentWorkflowBuilder 

Source
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>
where TState: Clone + Debug + Hash + Eq + Send + Sync + 'static, TParams: Clone + Send + Sync + 'static, TStore: Clone + Send + Sync + 'static,

Source

pub fn new(start_state: TState) -> Self

Create a new ConcurrentWorkflowBuilder with a starting state

Source

pub fn register<T>(self, state: TState, task: T) -> Self
where T: Task<TState, TStore, TParams> + Clone + Send + Sync + 'static,

Register a cloneable task for concurrent execution

Source

pub fn register_node<T>(self, state: TState, task: T) -> Self
where T: Task<TState, TStore, TParams> + Clone + Send + Sync + 'static,

👎Deprecated since 0.5.0: Use 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);
Source

pub fn add_exit_state(self, state: TState) -> Self

Add an exit state

Source

pub fn add_exit_states(self, states: Vec<TState>) -> Self

Add multiple exit states

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V