async_utils::futures

Trait FutureExt

Source
pub trait FutureExt: Future<Output = ()> {
    // Provided method
    fn replace_value<T>(self, value: T) -> ReplaceValue<Self, T> 
       where Self: Sized { ... }
}
Expand description

An extension trait for futures::Future that provides specialized adapters.

Provided Methods§

Source

fn replace_value<T>(self, value: T) -> ReplaceValue<Self, T>
where Self: Sized,

Map this future’s output to a different type, returning a new future of the resulting type.

This function is similar to futures::FutureExt::map except:

  • it takes a value instead of a closure

  • it returns a type that can be named

This function is useful when a mapped future is needed and boxing is not desired.

Implementors§

Source§

impl<T: ?Sized + Future<Output = ()>> FutureExt for T