fn take(self, n: usize) -> Take<Self>
    where
        Self: Sized,
    {
        assert_stream::<Self::Item, _>(Take::new(self, n))
    }
/// Creates a new stream of at most `n` items of the underlying stream.
///
/// Once `n` items have been yielded from this stream then it will always
/// return that the stream is done.
///
/// # Examples
///
/// ```
/// # futures::executor::block_on(async {
/// use futures::stream::{self, StreamExt};
///
/// let stream = stream::iter(1..=10).take(3);
///
/// assert_eq!(vec![1, 2, 3], stream.collect::<Vec<_>>().await);
/// # });
/// ```
Creates a new stream of at most `n` items of the underlying stream.
Once `n` items have been yielded from this stream then it will always
return that the stream is done.
Creates a new stream of at most ` n ` items of the underlying stream . Once ` n ` items have been yielded from this stream then it will always return that the stream is done .
fn take(self, n: usize) -> Take<Self>
    where
        Self: Sized,
    {
        assert_stream::<Self::Item, _>(Take::new(self, n))
    }
fn take ( self , n : usize ) -> Take < Self > where Self : Sized , { assert_stream :: < Self :: Item , _ > ( Take :: new ( self , n ) ) }
Creates a new stream of at most `n` items of the underlying stream.
Creates a new stream of at most ` n ` items of the underlying stream .
self
n
usize
self
n
usize
examples
None
futures::executor::block_on(async {
use futures::stream::{self, StreamExt}.




use futures :: stream :: { self StreamExt } .
});
None