[−][src]Struct async_jobs::Scheduler
Schedules execution of jobs and dependencies
Uses the builder pattern to configure various aspects of job execution.
use async_jobs::{Job, Outcome, Scheduler}; use async_trait::async_trait; #[derive(PartialEq)] struct MyJob(String); #[async_trait] impl Job for MyJob { type Error = (); async fn run(&self) -> Result<Outcome, Self::Error> { println!("message: {}", self.0); Ok(Outcome::Success) } fn dependencies(&self) -> Vec<Self> { vec![] } } Scheduler::default() .run(MyJob("hello, world".into()));
Implementations
impl Scheduler
[src]
pub async fn run<J: Job, '_>(&'_ self, job: J) -> Result<(), Error<J::Error>>
[src]
Executes job
and its dependencies
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Scheduler
impl Send for Scheduler
impl Sync for Scheduler
impl Unpin for Scheduler
impl UnwindSafe for Scheduler
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,