fn for_each<Fut, F>(self, f: F) -> ForEach<Self, Fut, F>
    where
        F: FnMut(Self::Item) -> Fut,
        Fut: Future<Output = ()>,
        Self: Sized,
    {
        assert_future::<(), _>(ForEach::new(self, f))
    }
/// Runs this stream to completion, executing the provided asynchronous
/// closure for each element on the stream.
///
/// The closure provided will be called for each item this stream produces,
/// yielding a future. That future will then be executed to completion
/// before moving on to the next item.
///
/// The returned value is a `Future` where the `Output` type is `()`; it is
/// executed entirely for its side effects.
///
/// To process each item in the stream and produce another stream instead
/// of a single future, use `then` instead.
///
/// # Examples
///
/// ```
/// # futures::executor::block_on(async {
/// use futures::future;
/// use futures::stream::{self, StreamExt};
///
/// let mut x = 0;
///
/// {
///     let fut = stream::repeat(1).take(3).for_each(|item| {
///         x += item;
///         future::ready(())
///     });
///     fut.await;
/// }
///
/// assert_eq!(x, 3);
/// # });
/// ```
Runs this stream to completion, executing the provided asynchronous
closure for each element on the stream.

The closure provided will be called for each item this stream produces,
yielding a future. That future will then be executed to completion
before moving on to the next item.



To process each item in the stream and produce another stream instead
of a single future, use `then` instead.
Runs this stream to completion executing the provided asynchronous closure for each element on the stream . The closure provided will be called for each item this stream produces yielding a future . That future will then be executed to completion before moving on to the next item . To process each item in the stream and produce another stream instead of a single future use ` then ` instead .
fn for_each<Fut, F>(self, f: F) -> ForEach<Self, Fut, F>
    where
        F: FnMut(Self::Item) -> Fut,
        Fut: Future<Output = ()>,
        Self: Sized,
    {
        assert_future::<(), _>(ForEach::new(self, f))
    }
fn for_each < Fut , F > ( self , f : F ) -> ForEach < Self , Fut , F > where F : FnMut ( Self :: Item ) -> Fut , Fut : Future < Output = ( ) > , Self : Sized , { assert_future :: < ( ) , _ > ( ForEach :: new ( self , f ) ) }
Runs this stream to completion, executing the provided asynchronous
closure for each element on the stream.
Runs this stream to completion executing the provided asynchronous closure for each element on the stream .
self
f
F
self
f
F
examples
None
futures::executor::block_on(async {
use futures::future;
use futures::stream::{self, StreamExt}.

let mut x = 0.




use futures :: future ; use futures :: stream :: { self StreamExt } . let mut x = 0 .
});
None