Skeleton cycle

poc-serde-support
Felipe Sere 5 years ago
parent fa91d7f856
commit dea1b67670

@ -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<T> {
source: Vec<T>,
index: usize,
}
impl<T: Copy> Stream for Cycle<T> {
type Item = T;
fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>> {
Poll::Pending
}
}

@ -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;

Loading…
Cancel
Save