pub struct DelayConfig { /* private fields */ }Expand description
Configuration for a delay step.
The delay is stored as whole seconds for serialization simplicity. Sub-second precision is not needed for workflow pauses (cooldowns, rate limiting, scheduled retries).
§Examples
use ironflow_engine::config::delay::DelayConfig;
let config = DelayConfig::from_secs(300);
assert_eq!(config.duration(), std::time::Duration::from_secs(300));
let zero = DelayConfig::from_secs(0);
assert!(zero.is_zero());§Panics
DelayConfig::from_secs does not panic. Invalid durations
(negative or overflow) cannot be constructed because the inner
value is u64.
Implementations§
Source§impl DelayConfig
impl DelayConfig
Sourcepub fn from_secs(secs: u64) -> Self
pub fn from_secs(secs: u64) -> Self
Create a delay configuration with the given number of seconds.
§Examples
use ironflow_engine::config::delay::DelayConfig;
let config = DelayConfig::from_secs(60);
assert_eq!(config.duration_secs(), 60);Sourcepub fn duration_secs(&self) -> u64
pub fn duration_secs(&self) -> u64
The raw seconds value.
Trait Implementations§
Source§impl Clone for DelayConfig
impl Clone for DelayConfig
Source§fn clone(&self) -> DelayConfig
fn clone(&self) -> DelayConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 DelayConfig
impl Debug for DelayConfig
Source§impl<'de> Deserialize<'de> for DelayConfig
impl<'de> Deserialize<'de> for DelayConfig
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 DelayConfig
impl RefUnwindSafe for DelayConfig
impl Send for DelayConfig
impl Sync for DelayConfig
impl Unpin for DelayConfig
impl UnsafeUnpin for DelayConfig
impl UnwindSafe for DelayConfig
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