about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorJörg Thalheim <joerg@thalheim.io>2017-03-26 18:54:08 +0200
committerJörg Thalheim <joerg@thalheim.io>2017-03-26 19:14:03 +0200
commit2cf686f2cdd6446a3cd47df0305ead40fabe85df (patch)
treefa62e1fd3d0c6319d3439eb98e40376f8e8e28c8 /src/rustllvm/RustWrapper.cpp
parent7846dbe0c8de17f59cdfc3d2b914d58faad7eade (diff)
downloadrust-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/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions