From 0558c395202c48a2c9d92d34f5302d09e5e51344 Mon Sep 17 00:00:00 2001 From: Michal 'vorner' Vaner Date: Sun, 15 Sep 2019 20:19:36 +0200 Subject: [PATCH] Support std::io::{Empty, Sink} MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add async support for the „stub“ helpers of std::io. --- futures-io/src/lib.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/futures-io/src/lib.rs b/futures-io/src/lib.rs index 551ee0700a..87d8ebe92c 100644 --- a/futures-io/src/lib.rs +++ b/futures-io/src/lib.rs @@ -42,6 +42,8 @@ mod if_std { IoSlice as IoSlice, IoSliceMut as IoSliceMut, SeekFrom as SeekFrom, + Sink as Sink, + Empty as Empty, }; #[cfg(feature = "read_initializer")] @@ -390,6 +392,10 @@ mod if_std { delegate_async_read_to_stdio!(); } + impl AsyncRead for Empty { + delegate_async_read_to_stdio!(); + } + macro_rules! deref_async_write { () => { fn poll_write(mut self: Pin<&mut Self>, cx: &mut Context<'_>, buf: &[u8]) @@ -509,6 +515,10 @@ mod if_std { delegate_async_write_to_stdio!(); } + impl AsyncWrite for Sink { + delegate_async_write_to_stdio!(); + } + macro_rules! deref_async_seek { () => { fn poll_seek(mut self: Pin<&mut Self>, cx: &mut Context<'_>, pos: SeekFrom)