mirror of
https://github.com/async-rs/async-std.git
synced 2025-02-16 01:09:40 +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,33 +7,10 @@ use crate::task::{Context, Poll, ready};
|
|||
|
||||
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
|
||||
/// value.
|
||||
///
|
||||
/// #Examples
|
||||
/// # Examples
|
||||
///
|
||||
/// ```
|
||||
/// # fn main() { async_std::task::block_on(async {
|
||||
|
@ -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>
|
||||
where
|
||||
Fut: Future<Output = Option<T>>,
|
||||
|
|
Loading…
Reference in a new issue