pub enum SubWorkflowOutcome {
Completed(SubWorkflowOutput),
Conflict(ConcurrencyConflict),
}Expand description
Result of a
workflow_with step.
§Examples
use ironflow_engine::executor::{ConcurrencyConflict, SubWorkflowOutcome};
use uuid::Uuid;
let outcome = SubWorkflowOutcome::Conflict(ConcurrencyConflict::new("issue:12", Uuid::nil()));
match &outcome {
SubWorkflowOutcome::Completed(output) => println!("child run {}", output.run_id()),
SubWorkflowOutcome::Conflict(conflict) => println!("held by {}", conflict.run_id()),
}
assert!(outcome.output().is_none());Variants§
Completed(SubWorkflowOutput)
The child run was created and finished.
Conflict(ConcurrencyConflict)
No child run was created: another active run holds the concurrency key.
Implementations§
Source§impl SubWorkflowOutcome
impl SubWorkflowOutcome
Sourcepub fn conflict(&self) -> Option<&ConcurrencyConflict>
pub fn conflict(&self) -> Option<&ConcurrencyConflict>
The conflict, when no child run was created.
§Examples
use ironflow_engine::executor::{ConcurrencyConflict, SubWorkflowOutcome};
use uuid::Uuid;
let outcome = SubWorkflowOutcome::Conflict(ConcurrencyConflict::new("k", Uuid::nil()));
assert_eq!(outcome.conflict().map(|c| c.key()), Some("k"));Sourcepub fn output(&self) -> Option<&SubWorkflowOutput>
pub fn output(&self) -> Option<&SubWorkflowOutput>
The child result, when the child run was created and finished.
§Examples
use ironflow_engine::executor::{SubWorkflowOutcome, SubWorkflowOutput};
use ironflow_store::entities::RunStatus;
use rust_decimal::Decimal;
use uuid::Uuid;
let output = SubWorkflowOutput::new(Uuid::nil(), "collect", RunStatus::Completed, Decimal::ZERO, 0);
let outcome = SubWorkflowOutcome::Completed(output.clone());
assert_eq!(outcome.output(), Some(&output));
assert!(outcome.conflict().is_none());Trait Implementations§
Source§impl Clone for SubWorkflowOutcome
impl Clone for SubWorkflowOutcome
Source§impl Debug for SubWorkflowOutcome
impl Debug for SubWorkflowOutcome
Source§impl PartialEq for SubWorkflowOutcome
impl PartialEq for SubWorkflowOutcome
impl StructuralPartialEq for SubWorkflowOutcome
Auto Trait Implementations§
impl Freeze for SubWorkflowOutcome
impl RefUnwindSafe for SubWorkflowOutcome
impl Send for SubWorkflowOutcome
impl Sync for SubWorkflowOutcome
impl Unpin for SubWorkflowOutcome
impl UnsafeUnpin for SubWorkflowOutcome
impl UnwindSafe for SubWorkflowOutcome
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