pub enum RestartPolicy {
Never,
OnFailure,
Always {
interval: Option<Duration>,
},
}Expand description
Policy controlling whether a task is restarted after completion or failure.
Variants§
Never
Never restart: the task runs once and exits permanently.
OnFailure
Restart only on failure (default).
Always
Always restart: the task restarts unconditionally after it finishes or fails.
interval: Optional delay between successful completions.None→ restart immediately after successSome(dur)→ waitdurbefore next cycle
Trait Implementations§
Source§impl Clone for RestartPolicy
impl Clone for RestartPolicy
Source§fn clone(&self) -> RestartPolicy
fn clone(&self) -> RestartPolicy
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 RestartPolicy
impl Debug for RestartPolicy
Source§impl Default for RestartPolicy
impl Default for RestartPolicy
Source§fn default() -> Self
fn default() -> Self
Returns RestartPolicy::OnFailure.
impl Copy for RestartPolicy
Auto Trait Implementations§
impl Freeze for RestartPolicy
impl RefUnwindSafe for RestartPolicy
impl Send for RestartPolicy
impl Sync for RestartPolicy
impl Unpin for RestartPolicy
impl UnsafeUnpin for RestartPolicy
impl UnwindSafe for RestartPolicy
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