[][src]Trait casper_node::effect::EffectOptionExt

pub trait EffectOptionExt {
    type Value;
    fn option<U, F, G>(self, f_some: F, f_none: G) -> Effects<U>
    where
        F: FnOnce(Self::Value) -> U + 'static + Send,
        G: FnOnce() -> U + 'static + Send,
        U: 'static
; }

Effect extension for futures, used to convert futures returning an Option into two different effects.

Associated Types

type Value

The type the future will return if Some.

Loading content...

Required methods

fn option<U, F, G>(self, f_some: F, f_none: G) -> Effects<U> where
    F: FnOnce(Self::Value) -> U + 'static + Send,
    G: FnOnce() -> U + 'static + Send,
    U: 'static, 

Finalizes a future returning an Option into two different effects.

The function f_some is used to translate the returned value from an effect into an event, while the function f_none does the same for a returned None.

Loading content...

Implementors

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

type Value = V

Loading content...