Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement AsRawFd/IntoRawFd for RawFd
This is useful to build os abstraction like the nix crate does. It allows to define functions, which accepts generic arguments of data structures convertible to RawFd, including RawFd itself. For example: fn write<FD: AsRawFd>(fd: FD, buf: &[u8]) -> Result<usize> instead of: fn write(fd: RawFd, buf: &[u8]) -> Result<usize> write(foo.as_raw_fd(), buf);
- Loading branch information