Trait futures_concurrency::future::TryMerge
source · [−]pub trait TryMerge {
type Output;
type Error;
fn try_merge<'async_trait>(
self
) -> Pin<Box<dyn Future<Output = Result<Self::Output, Self::Error>> + 'async_trait>>
where
Self: 'async_trait;
}
Expand description
Wait for all futures to complete successfully, or abort early on error.
In the case a future errors, all other futures will be cancelled. If futures have been completed, their results will be discarded.
If you want to keep partial data in the case of failure, see the merge
operation.
Required Associated Types
Required Methods
sourcefn try_merge<'async_trait>(
self
) -> Pin<Box<dyn Future<Output = Result<Self::Output, Self::Error>> + 'async_trait>>where
Self: 'async_trait,
fn try_merge<'async_trait>(
self
) -> Pin<Box<dyn Future<Output = Result<Self::Output, Self::Error>> + 'async_trait>>where
Self: 'async_trait,
Waits for multiple futures to complete, either returning when all futures complete successfully, or return early when any future completes with an error.