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

pub trait EffectOptionExt {
    type Value;
    pub fn map_or_else<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
;
pub fn map_some<U, F>(self, f: F) -> Effects<U>
    where
        F: FnOnce(Self::Value) -> U + 'static + Send,
        U: 'static
; }

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

Associated Types

type Value[src]

The type the future will return if Some.

Loading content...

Required methods

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

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.

pub fn map_some<U, F>(self, f: F) -> Effects<U> where
    F: FnOnce(Self::Value) -> U + 'static + Send,
    U: 'static, 
[src]

Finalizes a future returning an Option into two different effects.

The function f is used to translate the returned value from an effect into an event, In the case of None, empty vector of effects is returned.

Loading content...

Implementors

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

type Value = V

pub fn map_some<U, F>(self, f: F) -> Effects<U> where
    F: FnOnce(Self::Value) -> U + 'static + Send,
    U: 'static, 
[src]

Finalizes a future returning an Option.

The function f is used to translate the returned value from an effect into an event, In the case of None, empty vector is returned.

Loading content...