pub struct ScheduleDefinition {
pub policy: SchedulePolicy,
pub immediate: bool,
pub missed_tasks: MissedTasksPolicy,
pub new_task: NewTask,
pub labels: HashMap<String, Value>,
}
Expand description
A schedule supports repeatedly spawning jobs based on the given settings.
Fields§
§policy: SchedulePolicy
The task schedule policy.
immediate: bool
Whether to immediately spawn a task when the schedule is first processed.
missed_tasks: MissedTasksPolicy
The policy for missed tasks.
new_task: NewTask
Parameters for newly spawned tasks.
labels: HashMap<String, Value>
Schedule labels.
Implementations§
Source§impl ScheduleDefinition
impl ScheduleDefinition
Sourcepub fn new(policy: SchedulePolicy, new_task: NewTask) -> Self
pub fn new(policy: SchedulePolicy, new_task: NewTask) -> Self
Create a new schedule.
Sourcepub fn immediate(self, immediate: bool) -> Self
pub fn immediate(self, immediate: bool) -> Self
Set whether a task should be immediately scheduled when the schedule is added.
Sourcepub fn on_missed_tasks(self, policy: MissedTasksPolicy) -> Self
pub fn on_missed_tasks(self, policy: MissedTasksPolicy) -> Self
Set the missed tasks policy.
Sourcepub fn with_label(self, name: &str, value: impl Serialize) -> Self
pub fn with_label(self, name: &str, value: impl Serialize) -> Self
Trait Implementations§
Source§impl Clone for ScheduleDefinition
impl Clone for ScheduleDefinition
Source§fn clone(&self) -> ScheduleDefinition
fn clone(&self) -> ScheduleDefinition
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 ScheduleDefinition
impl Debug for ScheduleDefinition
Source§impl<'de> Deserialize<'de> for ScheduleDefinition
impl<'de> Deserialize<'de> for ScheduleDefinition
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 ScheduleDefinition
impl RefUnwindSafe for ScheduleDefinition
impl Send for ScheduleDefinition
impl Sync for ScheduleDefinition
impl Unpin for ScheduleDefinition
impl UnwindSafe for ScheduleDefinition
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