fn and_then<Fut, F>(self, f: F) -> AndThen<Self, Fut, F>
    where
        F: FnMut(Self::Ok) -> Fut,
        Fut: TryFuture<Error = Self::Error>,
        Self: Sized,
    {
        assert_stream::<Result<Fut::Ok, Fut::Error>, _>(AndThen::new(self, f))
    }
/// Chain on a computation for when a value is ready, passing the successful
/// results to the provided closure `f`.
///
/// This function can be used to run a unit of work when the next successful
/// value on a stream is ready. The closure provided will be yielded a value
/// when ready, and the returned future will then be run to completion to
/// produce the next value on this stream.
///
/// Any errors produced by this stream will not be passed to the closure,
/// and will be passed through.
///
/// The returned value of the closure must implement the `TryFuture` trait
/// and can represent some more work to be done before the composed stream
/// is finished.
///
/// Note that this function consumes the receiving stream and returns a
/// wrapped version of it.
///
/// To process the entire stream and return a single future representing
/// success or error, use `try_for_each` instead.
///
/// # Examples
///
/// ```
/// use futures::channel::mpsc;
/// use futures::future;
/// use futures::stream::TryStreamExt;
///
/// let (_tx, rx) = mpsc::channel::<Result<i32, ()>>(1);
///
/// let rx = rx.and_then(|result| {
///     future::ok(if result % 2 == 0 {
///         Some(result)
///     } else {
///         None
///     })
/// });
/// ```
Chain on a computation for when a value is ready, passing the successful
results to the provided closure `f`.

This function can be used to run a unit of work when the next successful
value on a stream is ready. The closure provided will be yielded a value
when ready, and the returned future will then be run to completion to
produce the next value on this stream.

Any errors produced by this stream will not be passed to the closure,
and will be passed through.

The returned value of the closure must implement the `TryFuture` trait
and can represent some more work to be done before the composed stream
is finished.

Note that this function consumes the receiving stream and returns a
wrapped version of it.

To process the entire stream and return a single future representing
success or error, use `try_for_each` instead.
Chain on a computation for when a value is ready passing the successful results to the provided closure ` f ` . This function can be used to run a unit of work when the next successful value on a stream is ready . The closure provided will be yielded a value when ready and the returned future will then be run to completion to produce the next value on this stream . Any errors produced by this stream will not be passed to the closure and will be passed through . The returned value of the closure must implement the ` TryFuture ` trait and can represent some more work to be done before the composed stream is finished . Note that this function consumes the receiving stream and returns a wrapped version of it . To process the entire stream and return a single future representing success or error use ` try_for_each ` instead .
fn and_then<Fut, F>(self, f: F) -> AndThen<Self, Fut, F>
    where
        F: FnMut(Self::Ok) -> Fut,
        Fut: TryFuture<Error = Self::Error>,
        Self: Sized,
    {
        assert_stream::<Result<Fut::Ok, Fut::Error>, _>(AndThen::new(self, f))
    }
fn and_then < Fut , F > ( self , f : F ) -> AndThen < Self , Fut , F > where F : FnMut ( Self :: Ok ) -> Fut , Fut : TryFuture < Error = Self :: Error > , Self : Sized , { assert_stream :: < Result < Fut :: Ok , Fut :: Error > , _ > ( AndThen :: new ( self , f ) ) }
Chain on a computation for when a value is ready, passing the successful
results to the provided closure `f`.
Chain on a computation for when a value is ready passing the successful results to the provided closure ` f ` .
self
f
F
self
f
F
examples
```
use futures::channel::mpsc;
use futures::future;
use futures::stream::TryStreamExt.



let rx = rx.and_then(|result| {
future::ok(if result % 2 == 0 {
Some(result)
} else {
None
})
});
```
` ` ` use futures :: channel :: mpsc ; use futures :: future ; use futures :: stream :: TryStreamExt . let rx = rx . and_then ( |result| { future :: ok ( if result % 2 == 0 { Some ( result ) } else { None } ) } ) ; ` ` `