diff --git a/src/stream/stream/cycle.rs b/src/stream/stream/cycle.rs index 881377f2..7ed0774e 100644 --- a/src/stream/stream/cycle.rs +++ b/src/stream/stream/cycle.rs @@ -18,3 +18,21 @@ impl Stream for Cycle { Poll::Pending } } + +/// # Examples +/// +/// Basic usage: +/// +/// ``` +/// # fn main() -> std::io::Result<()> { async_std::task::block_on(async { +/// +/// let values = vec![1,2,3]; +/// +/// # Ok(()) }) } +///``` +fn cycle(values: Vec) -> impl Stream { + Cycle { + source: values, + index: 0, + } +}