Function futures::stream::once [−][src]
pub fn once<T, E>(item: Result<T, E>) -> Once<T, E>
Creates a stream of single element
use futures::*; let mut stream = stream::once::<(), _>(Err(17)); assert_eq!(Err(17), stream.poll()); assert_eq!(Ok(Async::Ready(None)), stream.poll());