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 read_buf; |
14 | mod reader_stream; |
15 | mod stream_reader; |
16 | cfg_io_util! { |
17 | mod sync_bridge; |
18 | pub use self::sync_bridge::SyncIoBridge; |
19 | } |
20 | |
21 | pub use self::read_buf::read_buf; |
22 | pub use self::reader_stream::ReaderStream; |
23 | pub use self::stream_reader::StreamReader; |
24 | pub use crate::util::{poll_read_buf, poll_write_buf}; |
25 | |