[][src]Trait casper_node::effect::EffectResultExt

pub trait EffectResultExt {
    type Value;
    type Error;
    fn result<U, F, G>(self, f_ok: F, f_err: G) -> Effects<U>
    where
        F: FnOnce(Self::Value) -> U + 'static + Send,
        G: FnOnce(Self::Error) -> U + 'static + Send,
        U: 'static
; }

Effect extension for futures, used to convert futures returning a Result into two different effects.

Associated Types

type Value

The type the future will return if Ok.

type Error

The type the future will return if Err.

Loading content...

Required methods

fn result<U, F, G>(self, f_ok: F, f_err: G) -> Effects<U> where
    F: FnOnce(Self::Value) -> U + 'static + Send,
    G: FnOnce(Self::Error) -> U + 'static + Send,
    U: 'static, 

Finalizes a future returning a Result into two different effects.

The function f_ok is used to translate the returned value from an effect into an event, while the function f_err does the same for a potential error.

Loading content...

Implementors

impl<T, V, E> EffectResultExt for T where
    T: Future<Output = Result<V, E>> + Send + 'static + Sized,
    T: ?Sized
[src]

type Value = V

type Error = E

Loading content...