pub trait FutureResultCollection<T, E>: FutureCollection<Result<T, E>> {
// Required methods
fn expect_ok(self, timeout: Duration, error_msg: &'static str);
fn collect_ok<B>(self) -> B
where B: FromIterator<T>;
fn collect_ok_with_timeout<B>(
self,
timeout: Duration,
error_msg: &'static str,
) -> B
where B: FromIterator<T>;
}Expand description
Convenience methods for collections containing future results
Required Methods§
Sourcefn expect_ok(self, timeout: Duration, error_msg: &'static str)
fn expect_ok(self, timeout: Duration, error_msg: &'static str)
Wait for all futures to complete successfully but ignore the result
Panics if any future fails to complete in time or the result is Err.
Panics use the provided error_msg.
Timeout values are per future, not overall.
Sourcefn collect_ok<B>(self) -> Bwhere
B: FromIterator<T>,
fn collect_ok<B>(self) -> Bwhere
B: FromIterator<T>,
Collect all the future results into a collection of type B
Panics if any future fails to complete or the result is Err.
Sourcefn collect_ok_with_timeout<B>(
self,
timeout: Duration,
error_msg: &'static str,
) -> Bwhere
B: FromIterator<T>,
fn collect_ok_with_timeout<B>(
self,
timeout: Duration,
error_msg: &'static str,
) -> Bwhere
B: FromIterator<T>,
Collect all the future results into a collection of type B
Panics if any future fails to complete in time or the result is Err.
Panics use the provided error_msg.
Timeout values are per future, not overall.
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.