Construct an iterator which produces a single value once.
value
use std::iter::once; assert!(once(42).next().is_some()); assert_eq!(once(42).collect::<Vec>(), [42]);