pub struct JobSpec { /* private fields */ }Expand description
Schedule for a job submitted via ActorSystem::run_job.
max_iter— cap on iterations.None= run forever (untilabort_jobor the actor disappears).Some(n)exits afternsuccessful iterations.interval— wait between iterations.Noneis a single-shot job (max_iteris forced toSome(1)innew).start_at— earliest moment the first iteration may run. If in the past, the job starts immediately. If in the future, the job loop sleeps until then before the first dispatch.
Implementations§
Source§impl JobSpec
impl JobSpec
Sourcepub fn new(
max_iter: Option<usize>,
interval: Option<Duration>,
start_at: SystemTime,
) -> Self
pub fn new( max_iter: Option<usize>, interval: Option<Duration>, start_at: SystemTime, ) -> Self
Build a JobSpec. If interval is None, max_iter is forced
to Some(1) regardless of the value you pass — single-shot jobs
always run exactly once.
Sourcepub fn start_at(&self) -> SystemTime
pub fn start_at(&self) -> SystemTime
Earliest moment the first iteration may run.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for JobSpec
impl RefUnwindSafe for JobSpec
impl Send for JobSpec
impl Sync for JobSpec
impl Unpin for JobSpec
impl UnsafeUnpin for JobSpec
impl UnwindSafe for JobSpec
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