Skip to main content

tokio_util/io/
mod.rs

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;
17pub mod simplex;
18mod sink_writer;
19mod std_adapter;
20mod stream_reader;
21mod write_all_vectored;
22
23cfg_io_util! {
24    mod read_arc;
25    pub use self::read_arc::read_exact_arc;
26
27    mod sync_bridge;
28    pub use self::sync_bridge::SyncIoBridge;
29}
30
31pub use self::copy_to_bytes::CopyToBytes;
32pub use self::inspect::{InspectReader, InspectWriter};
33pub use self::read_buf::read_buf;
34pub use self::reader_stream::ReaderStream;
35pub use self::sink_writer::SinkWriter;
36pub use self::std_adapter::{StdWriteAdapter, StdWriteAdapterFuture};
37pub use self::stream_reader::StreamReader;
38pub use self::write_all_vectored::{write_all_vectored, WriteAllVectored};
39pub use crate::util::{poll_read_buf, poll_write_buf};