pub struct WorkflowInstance {
pub id: String,
pub workflow_identifier: Identifier,
pub state: Option<String>,
pub data: Map<String, Value>,
pub terminated: bool,
}Expand description
Workflow instance container.
TODO expand
Fields§
§id: StringWorkflow instance ID. Unique among all workflow instances.
workflow_identifier: IdentifierWorkflow identifier.
state: Option<String>Name of current workflow state, or None if workflow has completed.
data: Map<String, Value>Workflow data (a JSON object), passed between states.
If state is None, this is the final workflow output.
terminated: boolWhether workflow has terminated prematurely.
Implementations§
Source§impl WorkflowInstance
impl WorkflowInstance
Sourcepub fn for_definition(
definition: &WorkflowDefinition,
input: Option<Map<String, Value>>,
) -> Self
pub fn for_definition( definition: &WorkflowDefinition, input: Option<Map<String, Value>>, ) -> Self
Generates a new workflow instance from a WorkflowDefinition.
The instance will have a new, randomly-generated id, will start at the workflow’s
start state with the provided workflow input (or an empty JSON object if no initial
input is provided).
Sourcepub fn for_workflow_identifier<I>(
identifier: I,
state: Option<String>,
data: Option<Map<String, Value>>,
) -> Selfwhere
I: Into<Identifier>,
pub fn for_workflow_identifier<I>(
identifier: I,
state: Option<String>,
data: Option<Map<String, Value>>,
) -> Selfwhere
I: Into<Identifier>,
Generates a new workflow instance for a workflow identified via its Identifier.
The instance will have a new, randomly-generated id, will point to the given state
and contain the given data (or an empty JSON object if no data is provided).
Trait Implementations§
Source§impl Clone for WorkflowInstance
impl Clone for WorkflowInstance
Source§fn clone(&self) -> WorkflowInstance
fn clone(&self) -> WorkflowInstance
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WorkflowInstance
impl Debug for WorkflowInstance
Source§impl<'de> Deserialize<'de> for WorkflowInstance
impl<'de> Deserialize<'de> for WorkflowInstance
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for WorkflowInstance
impl RefUnwindSafe for WorkflowInstance
impl Send for WorkflowInstance
impl Sync for WorkflowInstance
impl Unpin for WorkflowInstance
impl UnwindSafe for WorkflowInstance
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more