pub struct LocalJobs { /* private fields */ }Expand description
Sets and cancels jobs at a local time, each under a key the app chooses, such as
digest:<account id>, so setting it again moves it.
Implementations§
Source§impl LocalJobs
impl LocalJobs
Sourcepub fn within(db: &Db, reach: Reach) -> Self
pub fn within(db: &Db, reach: Reach) -> Self
For a package resolving its own arguments: what reach owns is what it writes.
Sourcepub async fn set<Args, J: Call<JobContext, Args>>(
&self,
key: &str,
job: J,
payload: &impl Serialize,
at: LocalDateTime,
repeat: Repeat,
) -> Result<LocalScheduled>
pub async fn set<Args, J: Call<JobContext, Args>>( &self, key: &str, job: J, payload: &impl Serialize, at: LocalDateTime, repeat: Repeat, ) -> Result<LocalScheduled>
The first run is the next time at falls at or after now; a single one already past runs at once.
Sourcepub async fn cancel(&self, key: &str) -> Result<LocalScheduled>
pub async fn cancel(&self, key: &str) -> Result<LocalScheduled>
Nothing changes when no schedule has the key.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for LocalJobs
impl !UnwindSafe for LocalJobs
impl Forget for LocalJobs
impl Freeze for LocalJobs
impl Send for LocalJobs
impl Sync for LocalJobs
impl Unpin for LocalJobs
impl UnsafeUnpin for LocalJobs
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