[][src]Function async_std::stream::from_iter

pub fn from_iter<I: IntoIterator>(
    iter: I
) -> FromIter<<I as IntoIterator>::IntoIter>

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);