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

Implement AsRawFd/IntoRawFd for RawFd #40842

Merged
merged 1 commit into from
Mar 31, 2017
Merged

Implement AsRawFd/IntoRawFd for RawFd #40842

merged 1 commit into from
Mar 31, 2017

Commits on Mar 26, 2017

  1. 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);
    Mic92 committed Mar 26, 2017
    Configuration menu
    Copy the full SHA
    2cf686f View commit details
    Browse the repository at this point in the history