1//! Helpers for IO related tasks.
2//!
3//! The stream types are often used in combination with hyper or reqwest, as they
4//! allow converting between a hyper [`Body`] and [`AsyncRead`].
5//!
6//! The [`SyncIoBridge`] type converts from the world of async I/O
7//! to synchronous I/O; this may often come up when using synchronous APIs
8//! inside [`tokio::task::spawn_blocking`].
9//!
10//! [`Body`]: https://docs.rs/hyper/0.13/hyper/struct.Body.html
11//! [`AsyncRead`]: tokio::io::AsyncRead
12
13mod copy_to_bytes;
14mod inspect;
15mod read_buf;
16mod reader_stream;
17mod sink_writer;
18mod stream_reader;
19
20cfg_io_util! {
21 mod sync_bridge;
22 pub use self::sync_bridge::SyncIoBridge;
23}
24
25pub use self::copy_to_bytes::CopyToBytes;
26pub use self::inspect::{InspectReader, InspectWriter};
27pub use self::read_buf::read_buf;
28pub use self::reader_stream::ReaderStream;
29pub use self::sink_writer::SinkWriter;
30pub use self::stream_reader::StreamReader;
31pub use crate::util::{poll_read_buf, poll_write_buf};
32