From be832f20cb30bc014cd2518617d9a7ce72f6480c Mon Sep 17 00:00:00 2001 From: Eliza Weisman Date: Wed, 29 Jan 2020 11:14:24 -0800 Subject: util: add futures-io/tokio::io compatibility layer (#2117) * util: add futures-io/tokio::io compatibility layer This PR adds a compatibility layer with conversions between the `tokio::io` and `futures-io` versions of the `AsyncRead` and `AsyncWrite` traits. I initially opened this PR against `tokio-compat`, but we decided that a compatibility layer for current versions of the `tokio` and `futures-io` crates (rather than for compatibility with legacy code) ought to go in `tokio-util` instead. See: https://github.com/tokio-rs/tokio-compat/pull/2#issuecomment-551310953 This is based on code originally written by @Nemo157 as part of the `futures-tokio-compat` crate, and is contributed on behalf of the original author: https://github.com/Nemo157/futures-tokio-compat/issues/2#issuecomment-544118866 Closes tokio-rs/tokio-compat#2 Co-authored-by: Wim Looman Signed-off-by: Eliza Weisman --- tokio-util/src/lib.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tokio-util/src/lib.rs') diff --git a/tokio-util/src/lib.rs b/tokio-util/src/lib.rs index 48c0fd16..4554516e 100644 --- a/tokio-util/src/lib.rs +++ b/tokio-util/src/lib.rs @@ -25,3 +25,7 @@ cfg_codec! { cfg_udp! { pub mod udp; } + +cfg_compat! { + pub mod compat; +} -- cgit v1.2.3