[−][src]Trait casper_node::effect::EffectOptionExt
Effect extension for futures, used to convert futures returning an Option into two different
effects.
Associated Types
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]
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.
pub fn map_some<U, F>(self, f: F) -> Effects<U> where
F: FnOnce(Self::Value) -> U + 'static + Send,
U: 'static, [src]
F: FnOnce(Self::Value) -> U + 'static + Send,
U: 'static,
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.
Implementors
impl<T, V> EffectOptionExt for T where
T: Future<Output = Option<V>> + Send + 'static + Sized,
T: ?Sized, [src]
T: Future<Output = Option<V>> + Send + 'static + Sized,
T: ?Sized,
type Value = V
pub fn map_or_else<U, F, G>(self, f_some: F, f_none: G) -> Effects<U> where
F: FnOnce(V) -> U + 'static + Send,
G: FnOnce() -> U + 'static + Send,
U: 'static, [src]
F: FnOnce(V) -> 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, [src]
F: FnOnce(Self::Value) -> U + 'static + Send,
U: 'static,
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.