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

pub trait EffectResultExt {
    type Value;
    type Error;
    pub 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[src]

The type the future will return if Ok.

type Error[src]

The type the future will return if Err.

Loading content...

Required methods

pub 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, 
[src]

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...