diff options
| author | bors <bors@rust-lang.org> | 2014-11-26 08:42:09 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-11-26 08:42:09 +0000 |
| commit | 61af40278909eb899f1bdfbb8c45d4e4fb3dad5d (patch) | |
| tree | 87d901e82bb5e19ed4e49216f2114c9ca060aee6 /src/libstd/sys/common | |
| parent | 8d7b3199d9a285b66b4f9a49d97234c956cb5e6c (diff) | |
| parent | 1e661642105a1033f1c155ceb1b2335dd11cb40a (diff) | |
| download | rust-61af40278909eb899f1bdfbb8c45d4e4fb3dad5d.tar.gz rust-61af40278909eb899f1bdfbb8c45d4e4fb3dad5d.zip | |
auto merge of #19169 : aturon/rust/fds, r=alexcrichton
This PR adds some internal infrastructure to allow the private `std::sys` module to access internal representation details of `std::io`. It then exposes those details in two new, platform-specific API surfaces: `std::os::unix` and `std::os::windows`. To start with, these will provide the ability to extract file descriptors, HANDLEs, SOCKETs, and so on from `std::io` types. More functionality, and more specific platforms (e.g. `std::os::linux`) will be added over time. Closes #18897
Diffstat (limited to 'src/libstd/sys/common')
| -rw-r--r-- | src/libstd/sys/common/mod.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/libstd/sys/common/mod.rs b/src/libstd/sys/common/mod.rs index 77edd7c5c4e..e382ec261a0 100644 --- a/src/libstd/sys/common/mod.rs +++ b/src/libstd/sys/common/mod.rs @@ -13,7 +13,7 @@ use io::{mod, IoError, IoResult}; use prelude::*; -use sys::{last_error, retry, fs}; +use sys::{last_error, retry}; use c_str::CString; use num::Int; use path::BytesContainer; @@ -84,10 +84,9 @@ pub fn keep_going(data: &[u8], f: |*const u8, uint| -> i64) -> i64 { return (origamt - amt) as i64; } -// traits for extracting representations from - -pub trait AsFileDesc { - fn as_fd(&self) -> &fs::FileDesc; +// A trait for extracting representations from std::io types +pub trait AsInner<Inner> { + fn as_inner(&self) -> &Inner; } pub trait ProcessConfig<K: BytesContainer, V: BytesContainer> { |
