[−][src]Trait futures_ext::FutureExt
A trait implemented by default for all Futures which extends the standard functionality.
Provided methods
pub fn discard(self) -> Discard<Self>
[src]
Map a Future
to have Item=()
and Error=()
. This is
useful when a future is being used to drive a computation
but the actual results aren't interesting (such as when used
with Handle::spawn()
).
pub fn boxify(self) -> BoxFuture<Self::Item, Self::Error> where
Self: 'static + Send,
[src]
Self: 'static + Send,
Create a Send
able boxed version of this Future
.
pub fn boxify_nonsend(self) -> BoxFutureNonSend<Self::Item, Self::Error> where
Self: 'static,
[src]
Self: 'static,
Create a non-Send
able boxed version of this Future
.
pub fn left_future<B>(self) -> Either<Self, B>
[src]
Shorthand for returning future::Either::A
pub fn right_future<A>(self) -> Either<A, Self>
[src]
Shorthand for returning future::Either::B
pub fn inspect_err<F>(self, f: F) -> InspectErr<Self, F> where
F: FnOnce(&Self::Error),
Self: Sized,
[src]
F: FnOnce(&Self::Error),
Self: Sized,
Similar to future::Future::inspect
, but runs the function on error
pub fn inspect_result<F>(self, f: F) -> InspectResult<Self, F> where
F: FnOnce(Result<&Self::Item, &Self::Error>),
Self: Sized,
[src]
F: FnOnce(Result<&Self::Item, &Self::Error>),
Self: Sized,
Similar to future::Future::inspect
, but runs the function on both
output or error of the Future treating it as a regular Result