Add docs + To unstable feature

yoshuawuyts-patch-1
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::stream::{IntoStream, Stream};
use crate::task::{Context, Poll}; 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)] #[allow(missing_debug_implementations)]
pub struct FlatMap<S: Stream, U: IntoStream, F> { pub struct FlatMap<S: Stream, U: IntoStream, F> {
inner: FlattenCompat<Map<S, F, S::Item, U>, U>, 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> pub struct Flatten<S: Stream>
where where
S::Item: IntoStream, S::Item: IntoStream,

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

Loading…
Cancel
Save