pub struct ApprovalConfig { /* private fields */ }Expand description
Configuration for a human approval step.
When the workflow reaches an approval step, the run transitions to
AwaitingApproval and waits for a human to approve or reject via
the API.
§Examples
use ironflow_engine::config::ApprovalConfig;
let config = ApprovalConfig::new("Deploy to production?");
assert_eq!(config.message(), "Deploy to production?");
assert!(config.timeout_seconds().is_none());Implementations§
Source§impl ApprovalConfig
impl ApprovalConfig
Sourcepub fn new(message: &str) -> Self
pub fn new(message: &str) -> Self
Create a new approval config with the given message.
§Examples
use ironflow_engine::config::ApprovalConfig;
let config = ApprovalConfig::new("Approve this deployment?");
assert_eq!(config.message(), "Approve this deployment?");Sourcepub fn with_timeout_seconds(self, seconds: u64) -> Self
pub fn with_timeout_seconds(self, seconds: u64) -> Self
Set an auto-reject timeout in seconds.
If no approval or rejection is received within this duration, the run is automatically rejected (marked as Failed).
§Examples
use ironflow_engine::config::ApprovalConfig;
let config = ApprovalConfig::new("Approve?")
.with_timeout_seconds(3600);
assert_eq!(config.timeout_seconds(), Some(3600));Sourcepub fn timeout_seconds(&self) -> Option<u64>
pub fn timeout_seconds(&self) -> Option<u64>
Optional auto-reject timeout in seconds.
Trait Implementations§
Source§impl Clone for ApprovalConfig
impl Clone for ApprovalConfig
Source§fn clone(&self) -> ApprovalConfig
fn clone(&self) -> ApprovalConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ApprovalConfig
impl Debug for ApprovalConfig
Source§impl<'de> Deserialize<'de> for ApprovalConfig
impl<'de> Deserialize<'de> for ApprovalConfig
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ApprovalConfig
impl RefUnwindSafe for ApprovalConfig
impl Send for ApprovalConfig
impl Sync for ApprovalConfig
impl Unpin for ApprovalConfig
impl UnsafeUnpin for ApprovalConfig
impl UnwindSafe for ApprovalConfig
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