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;
// Provided method
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> { ... }
}Expand description
A job that can be run asynchronously.
Required Associated Types§
Required Methods§
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.