From dea1b67670d79ac8f6ef692c514a62c1c4be7229 Mon Sep 17 00:00:00 2001 From: Felipe Sere Date: Thu, 24 Oct 2019 10:16:41 -0500 Subject: [PATCH] Skeleton cycle --- src/stream/stream/cycle.rs | 20 ++++++++++++++++++++ src/stream/stream/mod.rs | 5 +++-- 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 src/stream/stream/cycle.rs diff --git a/src/stream/stream/cycle.rs b/src/stream/stream/cycle.rs new file mode 100644 index 0000000..881377f --- /dev/null +++ b/src/stream/stream/cycle.rs @@ -0,0 +1,20 @@ +use std::pin::Pin; + +use pin_project_lite::pin_project; + +use crate::stream::Stream; +use crate::task::{Context, Poll}; + +/// A stream that will repeatedly yield the same list of elements +pub struct Cycle { + source: Vec, + index: usize, +} + +impl Stream for Cycle { + type Item = T; + + fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + Poll::Pending + } +} diff --git a/src/stream/stream/mod.rs b/src/stream/stream/mod.rs index e182c03..4a845f1 100644 --- a/src/stream/stream/mod.rs +++ b/src/stream/stream/mod.rs @@ -24,9 +24,10 @@ mod all; mod any; mod chain; -mod cmp; -mod copied; mod enumerate; +mod cycle; +mod copied; +mod cmp; mod eq; mod filter; mod filter_map;