pub struct Scheduler<Tz = Local>where
Tz: TimeZone,{ /* private fields */ }
Implementations§
Source§impl<Tz> Scheduler<Tz>
impl<Tz> Scheduler<Tz>
Sourcepub fn add_ext<T>(&self, ext: T)
pub fn add_ext<T>(&self, ext: T)
add a type to the map, you can use it later in the task closer
Sourcepub fn add(
&mut self,
job: Box<dyn Job<Tz> + Send + 'static>,
) -> &mut Scheduler<Tz>
pub fn add( &mut self, job: Box<dyn Job<Tz> + Send + 'static>, ) -> &mut Scheduler<Tz>
add a new task to the scheduler, you must privide something that implements Job
trait.
Sourcepub async fn run_pending(&self)
pub async fn run_pending(&self)
Start the timer, block the current thread.
Auto Trait Implementations§
impl<Tz> Freeze for Scheduler<Tz>where
Tz: Freeze,
impl<Tz = Local> !RefUnwindSafe for Scheduler<Tz>
impl<Tz> Send for Scheduler<Tz>where
Tz: Send,
impl<Tz = Local> !Sync for Scheduler<Tz>
impl<Tz> Unpin for Scheduler<Tz>where
Tz: Unpin,
impl<Tz = Local> !UnwindSafe for Scheduler<Tz>
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