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

util: impl AsRawFd/AsRawHandle for Compat<T> #3765

Merged
merged 1 commit into from
May 8, 2021
Merged

util: impl AsRawFd/AsRawHandle for Compat<T> #3765

merged 1 commit into from
May 8, 2021

Conversation

chrismooredev
Copy link
Contributor

Motivation

When appropriate, implement AsRawFd and AsRawHandle for tokio_util::compat::Compat<T>, so this wrapper type can be used in contexts requiring them.

I ran into this while trying to wrap tokio's Stdin/Stdout for usage with the futures crate, while still being able to check if they're a tty with crossterm.

Solution

A blanket impl passing AsRawFd/AsRawHandle through to the inner read/write type

Copy link
Member

@taiki-e taiki-e left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@taiki-e taiki-e added the A-tokio-util Area: The tokio-util crate label May 8, 2021
Copy link
Contributor

@Darksonn Darksonn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

@Darksonn Darksonn merged commit 05c3cf3 into tokio-rs:master May 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio-util Area: The tokio-util crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants