pub struct Sequence<Prev: Job, Next, F: FnOnce(Result<Prev::Output, Prev::Error>) -> Result<Next, Prev::Error> + Send + Sync> { /* private fields */ }Expand description
A struct representing a sequence where the second job is generated based on the first and the result is passed into its next function generator.
Trait Implementations§
Source§impl<Prev, Next, F> Job for Sequence<Prev, Next, F>
impl<Prev, Next, F> Job for Sequence<Prev, Next, F>
Source§async fn run(self) -> Result<Self::Output, Self::Error>
async fn run(self) -> Result<Self::Output, Self::Error>
Runs the sequence as a job and returns the result.
type Output = <Next as Job>::Output
Source§type Error = <Prev as Job>::Error
type Error = <Prev as Job>::Error
Job-specific error type. Must be convertible into a boxed error so
WorkManager does not need to be generic over the error.Source§fn 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.
Source§impl<Prev, Next, F> Job for Sequence<Prev, Vec<Next>, F>
impl<Prev, Next, F> Job for Sequence<Prev, Vec<Next>, F>
Source§async fn run(self) -> Result<Self::Output, Self::Error>
async fn run(self) -> Result<Self::Output, Self::Error>
Runs the sequence as a job and returns the result.
type Output = Vec<<Next as Job>::Output>
Source§type Error = <Prev as Job>::Error
type Error = <Prev as Job>::Error
Job-specific error type. Must be convertible into a boxed error so
WorkManager does not need to be generic over the error.Source§fn 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.
Auto Trait Implementations§
impl<Prev, Next, F> Freeze for Sequence<Prev, Next, F>
impl<Prev, Next, F> RefUnwindSafe for Sequence<Prev, Next, F>where
Prev: RefUnwindSafe,
F: RefUnwindSafe,
impl<Prev, Next, F> Send for Sequence<Prev, Next, F>
impl<Prev, Next, F> Sync for Sequence<Prev, Next, F>
impl<Prev, Next, F> Unpin for Sequence<Prev, Next, F>
impl<Prev, Next, F> UnsafeUnpin for Sequence<Prev, Next, F>where
Prev: UnsafeUnpin,
F: UnsafeUnpin,
impl<Prev, Next, F> UnwindSafe for Sequence<Prev, Next, F>where
Prev: UnwindSafe,
F: UnwindSafe,
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