[][src]Trait kompact::prelude::FutureResultCollection

pub trait FutureResultCollection<T, E>: FutureCollection<Result<T, E>> {
    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>
; }

Convenience methods for collections containing future results

Required methods

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.

fn collect_ok<B>(self) -> B where
    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.

fn collect_ok_with_timeout<B>(
    self,
    timeout: Duration,
    error_msg: &'static str
) -> B where
    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.

Loading content...

Implementors

impl<I, T, E> FutureResultCollection<T, E> for I where
    T: Send + Sized + Debug,
    E: Send + Sized + Debug,
    I: IntoIterator<Item = KFuture<Result<T, E>>>, 
[src]

Loading content...