mirror of
https://github.com/async-rs/async-std.git
synced 2025-04-08 01:16:41 +00:00
Merge 3a6e75cc1d
into 96f564672a
This commit is contained in:
commit
719d50235b
4 changed files with 15 additions and 12 deletions
|
@ -41,8 +41,6 @@ use crate::utils::{timer_after, Timer};
|
|||
/// #
|
||||
/// # Ok(()) }) }
|
||||
/// ```
|
||||
#[cfg(feature = "unstable")]
|
||||
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
|
||||
pub fn interval(dur: Duration) -> Interval {
|
||||
Interval {
|
||||
delay: timer_after(dur),
|
||||
|
@ -56,8 +54,6 @@ pub fn interval(dur: Duration) -> Interval {
|
|||
/// documentation for more.
|
||||
///
|
||||
/// [`interval`]: fn.interval.html
|
||||
#[cfg(feature = "unstable")]
|
||||
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
|
||||
#[derive(Debug)]
|
||||
pub struct Interval {
|
||||
delay: Timer,
|
||||
|
|
|
@ -309,7 +309,9 @@
|
|||
pub use empty::{empty, Empty};
|
||||
pub use from_fn::{from_fn, FromFn};
|
||||
pub use from_iter::{from_iter, FromIter};
|
||||
pub use interval::{interval, Interval};
|
||||
pub use once::{once, Once};
|
||||
pub use pending::{pending, Pending};
|
||||
pub use repeat::{repeat, Repeat};
|
||||
pub use repeat_with::{repeat_with, RepeatWith};
|
||||
pub use stream::*;
|
||||
|
@ -319,7 +321,9 @@ pub(crate) mod stream;
|
|||
mod empty;
|
||||
mod from_fn;
|
||||
mod from_iter;
|
||||
mod interval;
|
||||
mod once;
|
||||
mod pending;
|
||||
mod repeat;
|
||||
mod repeat_with;
|
||||
|
||||
|
@ -329,9 +333,7 @@ cfg_unstable! {
|
|||
mod extend;
|
||||
mod from_stream;
|
||||
mod fused_stream;
|
||||
mod interval;
|
||||
mod into_stream;
|
||||
mod pending;
|
||||
mod product;
|
||||
mod successors;
|
||||
mod sum;
|
||||
|
@ -341,11 +343,8 @@ cfg_unstable! {
|
|||
pub use extend::{extend, Extend};
|
||||
pub use from_stream::FromStream;
|
||||
pub use fused_stream::FusedStream;
|
||||
pub use interval::{interval, Interval};
|
||||
pub use into_stream::IntoStream;
|
||||
pub use pending::{pending, Pending};
|
||||
pub use product::Product;
|
||||
pub use stream::Merge;
|
||||
pub use successors::{successors, Successors};
|
||||
pub use sum::Sum;
|
||||
}
|
||||
|
|
|
@ -2,7 +2,11 @@ use core::marker::PhantomData;
|
|||
use core::pin::Pin;
|
||||
use core::task::{Context, Poll};
|
||||
|
||||
use crate::stream::{DoubleEndedStream, ExactSizeStream, FusedStream, Stream};
|
||||
cfg_unstable! {
|
||||
use crate::stream::{DoubleEndedStream, ExactSizeStream, FusedStream};
|
||||
}
|
||||
|
||||
use crate::stream::Stream;
|
||||
|
||||
/// A stream that never returns any items.
|
||||
///
|
||||
|
@ -53,14 +57,20 @@ impl<T> Stream for Pending<T> {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "unstable")]
|
||||
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
|
||||
impl<T> DoubleEndedStream for Pending<T> {
|
||||
fn poll_next_back(self: Pin<&mut Self>, _: &mut Context<'_>) -> Poll<Option<T>> {
|
||||
Poll::Pending
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "unstable")]
|
||||
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
|
||||
impl<T> FusedStream for Pending<T> {}
|
||||
|
||||
#[cfg(feature = "unstable")]
|
||||
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
|
||||
impl<T> ExactSizeStream for Pending<T> {
|
||||
fn len(&self) -> usize {
|
||||
0
|
||||
|
|
|
@ -16,8 +16,6 @@ pin_project! {
|
|||
///
|
||||
/// [`merge`]: trait.Stream.html#method.merge
|
||||
/// [`Stream`]: trait.Stream.html
|
||||
#[cfg(feature = "unstable")]
|
||||
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
|
||||
#[derive(Debug)]
|
||||
pub struct Merge<L, R> {
|
||||
#[pin]
|
||||
|
|
Loading…
Reference in a new issue