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 | |
13 | mod copy_to_bytes; |
14 | mod inspect; |
15 | mod read_buf; |
16 | mod reader_stream; |
17 | mod sink_writer; |
18 | mod stream_reader; |
19 | |
20 | cfg_io_util! { |
21 | mod sync_bridge; |
22 | pub use self::sync_bridge::SyncIoBridge; |
23 | } |
24 | |
25 | pub use self::copy_to_bytes::CopyToBytes; |
26 | pub use self::inspect::{InspectReader, InspectWriter}; |
27 | pub use self::read_buf::read_buf; |
28 | pub use self::reader_stream::ReaderStream; |
29 | pub use self::sink_writer::SinkWriter; |
30 | pub use self::stream_reader::StreamReader; |
31 | pub use crate::util::{poll_read_buf, poll_write_buf}; |
32 | |