oconnor663 / os_pipe.rs

a cross-platform library for opening OS pipes in Rust
MIT License
100 stars 16 forks source link

Implement I/O safety traits #25

Closed notgull closed 2 years ago

notgull commented 2 years ago

This pull request adds a new feature: io_safety. When this feature is enabled, AsFd/Handle, From<OwnedFd/Handle> and Into<OwnedFd/Handle> are implemented for PipeReader and PipeWriter. Note that enabling this feature bumps the MSRV to 1.63.

See also: sunfishcode/io-lifetimes#38

oconnor663 commented 2 years ago

Awesome, thank you. It's nice to see that this is all safe code. Eventually (once we feel happy bumping the MSRV to 1.63) it'll probably make sense to switch PipeReader and PipeWriter from containing a File to containing an OwnedFd.

Would you like to get this released to crates.io sooner rather than later, or no rush?

notgull commented 2 years ago

No real rush, thanks!