pub struct WorkflowOptions {
pub allow_failure: bool,
/* private fields */
}Expand description
Options of a sub-workflow step started with
workflow_with.
§Examples
use ironflow_engine::config::WorkflowOptions;
let options = WorkflowOptions::new().allow_failure();
assert!(options.allow_failure);
assert!(!WorkflowOptions::default().allow_failure);Fields§
§allow_failure: boolTolerate a failed child run instead of failing the parent.
Implementations§
Source§impl WorkflowOptions
impl WorkflowOptions
Sourcepub fn new() -> Self
pub fn new() -> Self
Create options with every flag off.
§Examples
use ironflow_engine::config::WorkflowOptions;
assert_eq!(WorkflowOptions::new(), WorkflowOptions::default());Sourcepub fn allow_failure(self) -> Self
pub fn allow_failure(self) -> Self
Tolerate a failed child run: the step completes with the failure in its
output and the parent run ends as Warning. A suspension is never
tolerated.
§Examples
use ironflow_engine::config::WorkflowOptions;
assert!(WorkflowOptions::new().allow_failure().allow_failure);Sourcepub fn concurrency_key(self, key: impl Into<String>) -> Self
pub fn concurrency_key(self, key: impl Into<String>) -> Self
Make the child run exclusive on key.
While another non-terminal run (Pending, Running, Retrying, Sleeping,
AwaitingApproval) holds the same key, no child run is created and the
step completes with a
SubWorkflowOutcome::Conflict.
§Panics
Panics if key is empty or only whitespace, or longer than
MAX_CONCURRENCY_KEY_LEN bytes.
§Examples
use ironflow_engine::config::WorkflowOptions;
let options = WorkflowOptions::new().concurrency_key("issue:12");
assert_eq!(options.concurrency_key_ref(), Some("issue:12"));use ironflow_engine::config::WorkflowOptions;
WorkflowOptions::new().concurrency_key(" ");Sourcepub fn concurrency_key_ref(&self) -> Option<&str>
pub fn concurrency_key_ref(&self) -> Option<&str>
The concurrency key, if one was set.
§Examples
use ironflow_engine::config::WorkflowOptions;
let options = WorkflowOptions::new().concurrency_key("deploy:prod");
assert_eq!(options.concurrency_key_ref(), Some("deploy:prod"));Sourcepub fn priority(self, priority: i16) -> Self
pub fn priority(self, priority: i16) -> Self
Set the queue priority of the child run, overriding the priority of the child handler.
The child executes inside its parent’s worker; the priority is recorded on the child run and orders it whenever it waits in the queue.
§Panics
Panics if priority is outside
MIN_PRIORITY..=MAX_PRIORITY.
§Examples
use ironflow_engine::config::WorkflowOptions;
let options = WorkflowOptions::new().priority(20);
assert_eq!(options.priority_ref(), Some(20));use ironflow_engine::config::WorkflowOptions;
WorkflowOptions::new().priority(101);Sourcepub fn priority_ref(&self) -> Option<i16>
pub fn priority_ref(&self) -> Option<i16>
The priority of the child run, if one was set.
§Examples
use ironflow_engine::config::WorkflowOptions;
assert_eq!(WorkflowOptions::new().priority_ref(), None);
assert_eq!(WorkflowOptions::new().priority(-5).priority_ref(), Some(-5));Trait Implementations§
Source§impl Clone for WorkflowOptions
impl Clone for WorkflowOptions
Source§impl Debug for WorkflowOptions
impl Debug for WorkflowOptions
Source§impl Default for WorkflowOptions
impl Default for WorkflowOptions
impl Eq for WorkflowOptions
Source§impl PartialEq for WorkflowOptions
impl PartialEq for WorkflowOptions
impl StructuralPartialEq for WorkflowOptions
Auto Trait Implementations§
impl Freeze for WorkflowOptions
impl RefUnwindSafe for WorkflowOptions
impl Send for WorkflowOptions
impl Sync for WorkflowOptions
impl Unpin for WorkflowOptions
impl UnsafeUnpin for WorkflowOptions
impl UnwindSafe for WorkflowOptions
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.