Repository: tokio-rs/tokio
File: tokio-stream/src/lib.rs (Rust)

Code before:
//! [`tokio-util`] provides the [`StreamReader`] and [`ReaderStream`]
//! types when the io feature is enabled.
//!
//! [`tokio-util`]: https://docs.rs/tokio-util/latest/tokio_util/codec/index.html
//! [`tokio::io`]: https://docs.rs/tokio/latest/tokio/io/index.html
//! [`AsyncRead`]: https://docs.rs/tokio/latest/tokio/io/trait.AsyncRead.html
//! [`AsyncWrite`]: https://docs.rs/tokio/latest/tokio/io/trait.AsyncWrite.html
//! [`ReaderStream`]: https://docs.rs/tokio-util/latest/tokio_util/io/struct.ReaderStream.html
//! [`StreamReader`]: https://docs.rs/tokio-util/latest/tokio_util/io/struct.StreamReader.html

#[macro_use]
mod macros;

mod poll_fn;
pub(crate) use poll_fn::poll_fn;

pub mod wrappers;

mod stream_ext;
pub use stream_ext::{collect::FromStream, StreamExt};
/// Adapters for [`Stream`]s created by methods in [`StreamExt`].
pub mod adapters {
    pub use crate::stream_ext::{
        AllFuture, AnyFuture, Chain, Filter, FilterMap, FoldFuture, Fuse, Map, MapWhile, Merge,
        Next, Peekable, Skip, SkipWhile, Take, TakeWhile, Then, TryNext,
    };
    cfg_time! {
        pub use crate::stream_ext::{ChunksTimeout, timeout::Elapsed, Timeout, TimeoutRepeating};
    }
}

cfg_time! {
    #[deprecated = "Import those symbols from adapters instead"]
    #[doc(hidden)]
    pub use stream_ext::timeout::{Elapsed, Timeout};
}

mod empty;
pub use empty::{empty, Empty};

mod iter;
pub use iter::{iter, Iter};

mod once;
pub use once::{once, Once};

mod pending;
pub use pending::{pending, Pending};

mod stream_map;
pub use stream_map::StreamMap;

Review comment (suggestion):
Actually, can we drop `Next` from the list? I'd like to only export the ones that implement `Stream`, not the ones that implement `Future`.

Code after:
//! [`tokio-util`] provides the [`StreamReader`] and [`ReaderStream`]
//! types when the io feature is enabled.
//!
//! [`tokio-util`]: https://docs.rs/tokio-util/latest/tokio_util/codec/index.html
//! [`tokio::io`]: https://docs.rs/tokio/latest/tokio/io/index.html
//! [`AsyncRead`]: https://docs.rs/tokio/latest/tokio/io/trait.AsyncRead.html
//! [`AsyncWrite`]: https://docs.rs/tokio/latest/tokio/io/trait.AsyncWrite.html
//! [`ReaderStream`]: https://docs.rs/tokio-util/latest/tokio_util/io/struct.ReaderStream.html
//! [`StreamReader`]: https://docs.rs/tokio-util/latest/tokio_util/io/struct.StreamReader.html

#[macro_use]
mod macros;

mod poll_fn;
pub(crate) use poll_fn::poll_fn;

pub mod wrappers;

mod stream_ext;
pub use stream_ext::{collect::FromStream, StreamExt};
/// Adapters for [`Stream`]s created by methods in [`StreamExt`].
pub mod adapters {
    pub use crate::stream_ext::{
        Chain, Filter, FilterMap, Fuse, Map, MapWhile, Merge, Peekable, Skip, SkipWhile, Take,
        TakeWhile, Then,
    };
    cfg_time! {
        pub use crate::stream_ext::{ChunksTimeout, Timeout, TimeoutRepeating};
    }
}

cfg_time! {
    #[deprecated = "Import those symbols from adapters instead"]
    #[doc(hidden)]
    pub use stream_ext::timeout::Timeout;
    pub use stream_ext::timeout::Elapsed;
}

mod empty;
pub use empty::{empty, Empty};

mod iter;
pub use iter::{iter, Iter};

mod once;
pub use once::{once, Once};

mod pending;
pub use pending::{pending, Pending};

mod stream_map;