pub trait Job:
Send
+ Sync
+ Sized {
type Output: Send + Sync + 'static;
type Error: Send + Sync + 'static + Into<Box<dyn Error + Send + Sync>>;
// Required method
fn run(
self,
) -> impl Future<Output = Result<Self::Output, Self::Error>> + Send + Sync + 'static;
// Provided methods
fn then<F, Next>(self, next: F) -> Sequence<Self, Next, F>
where F: FnOnce(Result<Self::Output, Self::Error>) -> Result<Next, Self::Error> + Send + Sync,
Next: Job<Error = Self::Error> { ... }
fn then_many<F, Next>(self, next: F) -> Sequence<Self, Vec<Next>, F>
where F: FnOnce(Result<Self::Output, Self::Error>) -> Result<Vec<Next>, Self::Error> + Send + Sync,
Next: Job<Error = Self::Error> { ... }
}Expand description
A job that can be run asynchronously.
Required Associated Types§
Required Methods§
Provided Methods§
Sourcefn then<F, Next>(self, next: F) -> Sequence<Self, Next, F>
fn then<F, Next>(self, next: F) -> Sequence<Self, Next, F>
Turns this job into a sequence where the next job depends on the output of this job. Does not execute anything until the entire sequence is run.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".