Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support std::io::{Empty, Sink} #1872

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions futures-io/src/lib.rs
Expand Up @@ -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")]
Expand Down Expand Up @@ -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])
Expand Down Expand Up @@ -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)
Expand Down