Function streaming_iterator::once

source ·
pub fn once<T>(item: T) -> Once<T>
Expand description

Creates an iterator that returns exactly one item.

let mut streaming_iter = streaming_iterator::once(1);
assert_eq!(streaming_iter.next(), Some(&1));
assert_eq!(streaming_iter.next(), None);