Function feature_extension_for_async_std::stream::from_iter
source · pub fn from_iter<I>(iter: I) -> FromIter<<I as IntoIterator>::IntoIter>where
I: IntoIterator,
Expand description
Converts an iterator into a stream.
§Examples
use async_std::prelude::*;
use async_std::stream;
let mut s = stream::from_iter(vec![0, 1, 2, 3]);
assert_eq!(s.next().await, Some(0));
assert_eq!(s.next().await, Some(1));
assert_eq!(s.next().await, Some(2));
assert_eq!(s.next().await, Some(3));
assert_eq!(s.next().await, None);