diff options
| author | Jörg Thalheim <joerg@thalheim.io> | 2017-03-26 18:54:08 +0200 |
|---|---|---|
| committer | Jörg Thalheim <joerg@thalheim.io> | 2017-03-26 19:14:03 +0200 |
| commit | 2cf686f2cdd6446a3cd47df0305ead40fabe85df (patch) | |
| tree | fa62e1fd3d0c6319d3439eb98e40376f8e8e28c8 /src/test/run-pass/thinlto | |
| parent | 7846dbe0c8de17f59cdfc3d2b914d58faad7eade (diff) | |
| download | rust-2cf686f2cdd6446a3cd47df0305ead40fabe85df.tar.gz rust-2cf686f2cdd6446a3cd47df0305ead40fabe85df.zip | |
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);
Diffstat (limited to 'src/test/run-pass/thinlto')
0 files changed, 0 insertions, 0 deletions
