pub enum RunPolicy {
Once,
Repeat(RepeatPolicy),
}Expand description
A policy that defines how many times a task should be run.
Variants§
Implementations§
Source§impl RunPolicy
impl RunPolicy
Sourcepub fn repeat(count: u32, interval_secs: u64) -> Result<Self, RunPolicyError>
pub fn repeat(count: u32, interval_secs: u64) -> Result<Self, RunPolicyError>
Constructs a validated RunPolicy::Repeat policy.
This is the canonical constructor for repeat policies and enforces
the contract requirement that both count and interval_secs
are strictly positive.
Sourcepub fn validate(&self) -> Result<(), RunPolicyError>
pub fn validate(&self) -> Result<(), RunPolicyError>
Validates this run policy against contract invariants.
For RunPolicy::Repeat, validation is guaranteed at construction time
by RepeatPolicy::new, so this method always returns Ok(()).
Trait Implementations§
impl Eq for RunPolicy
impl StructuralPartialEq for RunPolicy
Auto Trait Implementations§
impl Freeze for RunPolicy
impl RefUnwindSafe for RunPolicy
impl Send for RunPolicy
impl Sync for RunPolicy
impl Unpin for RunPolicy
impl UnsafeUnpin for RunPolicy
impl UnwindSafe for RunPolicy
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