pub struct WorkManager<E> { /* private fields */ }Expand description
Manages the execution of asynchronous jobs.
Implementations§
Source§impl<E> WorkManager<E>
impl<E> WorkManager<E>
Source§impl<E: Debug + Send + Sync + 'static> WorkManager<E>
impl<E: Debug + Send + Sync + 'static> WorkManager<E>
Sourcepub fn enqueue(
&mut self,
name: &str,
job: impl Job<Error = E> + 'static,
overwrite: bool,
) -> bool
pub fn enqueue( &mut self, name: &str, job: impl Job<Error = E> + 'static, overwrite: bool, ) -> bool
Enqueues a job for execution.
If a job with the same name already exists, it will be overwritten if overwrite is true.
Sourcepub fn enqueue_periodic(
&mut self,
name: &str,
job: impl Job<Error = E> + Clone + 'static,
interval: Duration,
overwrite: bool,
panic: bool,
) -> bool
pub fn enqueue_periodic( &mut self, name: &str, job: impl Job<Error = E> + Clone + 'static, interval: Duration, overwrite: bool, panic: bool, ) -> bool
Enqueues a periodic job for execution at specified intervals.
If a job with the same name already exists, it will be overwritten if overwrite is true.
If panic is true, the periodic job will cancel and return the error upon encountering one.
Trait Implementations§
Auto Trait Implementations§
impl<E> Freeze for WorkManager<E>
impl<E> RefUnwindSafe for WorkManager<E>
impl<E> Send for WorkManager<E>where
E: Send,
impl<E> Sync for WorkManager<E>where
E: Send,
impl<E> Unpin for WorkManager<E>
impl<E> UnwindSafe for WorkManager<E>
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