Add docs + To unstable feature

pull/367/head
k-nasa 5 years ago
parent 1c1e2230f3
commit 410d16eaf6

@ -5,6 +5,11 @@ use crate::stream::stream::map::Map;
use crate::stream::{IntoStream, Stream};
use crate::task::{Context, Poll};
/// This `struct` is created by the [`flat_map`] method on [`Stream`]. See its
/// documentation for more.
///
/// [`flat_map`]: trait.Stream.html#method.flat_map
/// [`Stream`]: trait.Stream.html
#[allow(missing_debug_implementations)]
pub struct FlatMap<S: Stream, U: IntoStream, F> {
inner: FlattenCompat<Map<S, F, S::Item, U>, U>,
@ -39,6 +44,12 @@ where
}
}
/// This `struct` is created by the [`flatten`] method on [`Stream`]. See its
/// documentation for more.
///
/// [`flatten`]: trait.Stream.html#method.flatten
/// [`Stream`]: trait.Stream.html
#[allow(missing_debug_implementations)]
pub struct Flatten<S: Stream>
where
S::Item: IntoStream,

@ -30,7 +30,6 @@ mod filter;
mod filter_map;
mod find;
mod find_map;
mod flatten;
mod fold;
mod for_each;
mod fuse;
@ -78,7 +77,6 @@ use try_for_each::TryForEeachFuture;
pub use chain::Chain;
pub use filter::Filter;
pub use flatten::{FlatMap, Flatten};
pub use fuse::Fuse;
pub use inspect::Inspect;
pub use map::Map;
@ -93,17 +91,18 @@ pub use zip::Zip;
use std::cmp::Ordering;
use std::marker::PhantomData;
use crate::stream::IntoStream;
cfg_unstable! {
use std::pin::Pin;
use crate::future::Future;
use crate::stream::FromStream;
use crate::stream::into_stream::IntoStream;
pub use merge::Merge;
pub use flatten::{FlatMap, Flatten};
mod merge;
mod flatten;
}
extension_trait! {
@ -589,6 +588,8 @@ extension_trait! {
# });
```
"#]
#[cfg(feature = "unstable")]
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>
where
Self: Sized,
@ -621,6 +622,8 @@ extension_trait! {
# });
"#]
#[cfg(feature = "unstable")]
#[cfg_attr(feature = "docs", doc(cfg(unstable)))]
fn flatten(self) -> Flatten<Self>
where
Self: Sized,

Loading…
Cancel
Save