fn inspect_ok<F>(self, f: F) -> InspectOk<Self, F>
    where
        F: FnOnce(&Self::Ok),
        Self: Sized,
    {
        assert_future::<Result<Self::Ok, Self::Error>, _>(InspectOk::new(self, f))
    }
/// Do something with the success value of a future before passing it on.
///
/// When using futures, you'll often chain several of them together.  While
/// working on such code, you might want to check out what's happening at
/// various parts in the pipeline, without consuming the intermediate
/// value. To do that, insert a call to `inspect_ok`.
///
/// # Examples
///
/// ```
/// # futures::executor::block_on(async {
/// use futures::future::TryFutureExt;
///
/// let future = async { Ok::<_, ()>(1) };
/// let new_future = future.inspect_ok(|&x| println!("about to resolve: {}", x));
/// assert_eq!(new_future.await, Ok(1));
/// # });
/// ```
Do something with the success value of a future before passing it on.
When using futures, you'll often chain several of them together.  While
working on such code, you might want to check out what's happening at
various parts in the pipeline, without consuming the intermediate
value. To do that, insert a call to `inspect_ok`.
Do something with the success value of a future before passing it on . When using futures you ' ll often chain several of them together . While working on such code you might want to check out what ' s happening at various parts in the pipeline without consuming the intermediate value . To do that insert a call to ` inspect_ok ` .
fn inspect_ok<F>(self, f: F) -> InspectOk<Self, F>
    where
        F: FnOnce(&Self::Ok),
        Self: Sized,
    {
        assert_future::<Result<Self::Ok, Self::Error>, _>(InspectOk::new(self, f))
    }
fn inspect_ok < F > ( self , f : F ) -> InspectOk < Self , F > where F : FnOnce ( & Self :: Ok ) , Self : Sized , { assert_future :: < Result < Self :: Ok , Self :: Error > , _ > ( InspectOk :: new ( self , f ) ) }
Do something with the success value of a future before passing it on.
Do something with the success value of a future before passing it on .
self
f
F
self
f
F
examples
None
futures::executor::block_on(async {
use futures::future::TryFutureExt.

let future = async { Ok::<_, ()>(1) };
let new_future = future.inspect_ok(|&x| println!("about to resolve: {}", x));
assert_eq!(new_future.await, Ok(1)).
use futures :: future :: TryFutureExt . let future = async { Ok :: <_ () > ( 1 ) } ; let new_future = future . inspect_ok ( |&x| println! ( " about to resolve : {} " x )) ; assert_eq! ( new_future . await Ok ( 1 )) .
});
None