mirror of
https://github.com/async-rs/async-std.git
synced 2025-03-28 20:16:41 +00:00
Rearrange docs to match 'repeat'
This commit is contained in:
parent
4c09cdbeac
commit
bfb42b432e
1 changed files with 22 additions and 24 deletions
|
@ -7,29 +7,6 @@ use crate::task::{Context, Poll, ready};
|
||||||
|
|
||||||
use pin_project_lite::pin_project;
|
use pin_project_lite::pin_project;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
pin_project! {
|
|
||||||
/// A stream that yields elements by calling an async closure with the previous value as an
|
|
||||||
/// argument
|
|
||||||
///
|
|
||||||
/// This stream is constructed by [`successors`] function
|
|
||||||
///
|
|
||||||
/// [`succcessors`]: fn.succssors.html
|
|
||||||
#[cfg(feature = "unstable")]
|
|
||||||
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
|
|
||||||
#[derive(Debug)]
|
|
||||||
pub struct Successors<F, Fut, T>
|
|
||||||
where
|
|
||||||
Fut: Future<Output = Option<T>>,
|
|
||||||
{
|
|
||||||
succ: F,
|
|
||||||
#[pin]
|
|
||||||
future: Option<Fut>,
|
|
||||||
slot: Option<T>,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Creates a new stream where to produce each new element a closure is called with the previous
|
/// Creates a new stream where to produce each new element a closure is called with the previous
|
||||||
/// value.
|
/// value.
|
||||||
///
|
///
|
||||||
|
@ -82,6 +59,27 @@ where
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pin_project! {
|
||||||
|
/// A stream that yields elements by calling an async closure with the previous value as an
|
||||||
|
/// argument
|
||||||
|
///
|
||||||
|
/// This stream is constructed by [`successors`] function
|
||||||
|
///
|
||||||
|
/// [`successors`]: fn.succssors.html
|
||||||
|
#[cfg(feature = "unstable")]
|
||||||
|
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
|
||||||
|
#[derive(Debug)]
|
||||||
|
pub struct Successors<F, Fut, T>
|
||||||
|
where
|
||||||
|
Fut: Future<Output = Option<T>>,
|
||||||
|
{
|
||||||
|
succ: F,
|
||||||
|
#[pin]
|
||||||
|
future: Option<Fut>,
|
||||||
|
slot: Option<T>,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<F, Fut, T> Stream for Successors<F, Fut, T>
|
impl<F, Fut, T> Stream for Successors<F, Fut, T>
|
||||||
where
|
where
|
||||||
Fut: Future<Output = Option<T>>,
|
Fut: Future<Output = Option<T>>,
|
||||||
|
|
Loading…
Reference in a new issue