diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-03-27 15:10:28 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-03-31 15:47:35 -0700 |
| commit | 14587f88cac89af655e04d573ead2eb5ab4f37a5 (patch) | |
| tree | 17a5b5ec16166eb27a9148ef9a5d2a2291a8c3f0 | |
| parent | 5f33588d75966b939df288cf2125e9906e15cf82 (diff) | |
| download | rust-14587f88cac89af655e04d573ead2eb5ab4f37a5.tar.gz rust-14587f88cac89af655e04d573ead2eb5ab4f37a5.zip | |
native: Switch field privacy as necessary
| -rw-r--r-- | src/libnative/io/file_unix.rs | 6 | ||||
| -rw-r--r-- | src/libnative/io/file_win32.rs | 2 | ||||
| -rw-r--r-- | src/libnative/io/mod.rs | 2 | ||||
| -rw-r--r-- | src/libnative/io/net.rs | 8 | ||||
| -rw-r--r-- | src/libnative/io/pipe_unix.rs | 8 | ||||
| -rw-r--r-- | src/libnative/io/pipe_win32.rs | 14 | ||||
| -rw-r--r-- | src/libnative/io/process.rs | 6 | ||||
| -rw-r--r-- | src/libnative/io/timer_other.rs | 4 | ||||
| -rw-r--r-- | src/libnative/io/timer_timerfd.rs | 20 | ||||
| -rw-r--r-- | src/libnative/io/timer_win32.rs | 4 | ||||
| -rw-r--r-- | src/libnative/lib.rs | 2 |
11 files changed, 39 insertions, 37 deletions
diff --git a/src/libnative/io/file_unix.rs b/src/libnative/io/file_unix.rs index 2e33110b700..143228b14e9 100644 --- a/src/libnative/io/file_unix.rs +++ b/src/libnative/io/file_unix.rs @@ -30,7 +30,7 @@ struct Inner { } pub struct FileDesc { - priv inner: UnsafeArc<Inner> + inner: UnsafeArc<Inner> } impl FileDesc { @@ -216,8 +216,8 @@ impl Drop for Inner { } pub struct CFile { - priv file: *libc::FILE, - priv fd: FileDesc, + file: *libc::FILE, + fd: FileDesc, } impl CFile { diff --git a/src/libnative/io/file_win32.rs b/src/libnative/io/file_win32.rs index d9d7fbbce9c..c19e81b5de4 100644 --- a/src/libnative/io/file_win32.rs +++ b/src/libnative/io/file_win32.rs @@ -34,7 +34,7 @@ struct Inner { } pub struct FileDesc { - priv inner: UnsafeArc<Inner> + inner: UnsafeArc<Inner> } impl FileDesc { diff --git a/src/libnative/io/mod.rs b/src/libnative/io/mod.rs index 3536ec7dec6..e6e9cbb7ce3 100644 --- a/src/libnative/io/mod.rs +++ b/src/libnative/io/mod.rs @@ -215,7 +215,7 @@ fn keep_going(data: &[u8], f: |*u8, uint| -> i64) -> i64 { /// Implementation of rt::rtio's IoFactory trait to generate handles to the /// native I/O functionality. pub struct IoFactory { - priv cannot_construct_outside_of_this_module: () + cannot_construct_outside_of_this_module: () } impl IoFactory { diff --git a/src/libnative/io/net.rs b/src/libnative/io/net.rs index 6f6ddeec86b..bf751be1f7f 100644 --- a/src/libnative/io/net.rs +++ b/src/libnative/io/net.rs @@ -237,7 +237,7 @@ pub fn init() { //////////////////////////////////////////////////////////////////////////////// pub struct TcpStream { - priv inner: UnsafeArc<Inner>, + inner: UnsafeArc<Inner>, } struct Inner { @@ -373,7 +373,7 @@ impl Drop for Inner { //////////////////////////////////////////////////////////////////////////////// pub struct TcpListener { - priv inner: UnsafeArc<Inner>, + inner: UnsafeArc<Inner>, } impl TcpListener { @@ -430,7 +430,7 @@ impl rtio::RtioSocket for TcpListener { } pub struct TcpAcceptor { - priv listener: TcpListener, + listener: TcpListener, } impl TcpAcceptor { @@ -474,7 +474,7 @@ impl rtio::RtioTcpAcceptor for TcpAcceptor { //////////////////////////////////////////////////////////////////////////////// pub struct UdpSocket { - priv inner: UnsafeArc<Inner>, + inner: UnsafeArc<Inner>, } impl UdpSocket { diff --git a/src/libnative/io/pipe_unix.rs b/src/libnative/io/pipe_unix.rs index e25571d02c9..fb9ac27d830 100644 --- a/src/libnative/io/pipe_unix.rs +++ b/src/libnative/io/pipe_unix.rs @@ -106,7 +106,7 @@ fn bind(addr: &CString, ty: libc::c_int) -> IoResult<Inner> { //////////////////////////////////////////////////////////////////////////////// pub struct UnixStream { - priv inner: UnsafeArc<Inner>, + inner: UnsafeArc<Inner>, } impl UnixStream { @@ -160,7 +160,7 @@ impl rtio::RtioPipe for UnixStream { //////////////////////////////////////////////////////////////////////////////// pub struct UnixDatagram { - priv inner: UnsafeArc<Inner>, + inner: UnsafeArc<Inner>, } impl UnixDatagram { @@ -231,7 +231,7 @@ impl UnixDatagram { //////////////////////////////////////////////////////////////////////////////// pub struct UnixListener { - priv inner: Inner, + inner: Inner, } impl UnixListener { @@ -256,7 +256,7 @@ impl rtio::RtioUnixListener for UnixListener { } pub struct UnixAcceptor { - priv listener: UnixListener, + listener: UnixListener, } impl UnixAcceptor { diff --git a/src/libnative/io/pipe_win32.rs b/src/libnative/io/pipe_win32.rs index d629e5867c9..36f2dc7d65c 100644 --- a/src/libnative/io/pipe_win32.rs +++ b/src/libnative/io/pipe_win32.rs @@ -154,9 +154,9 @@ unsafe fn pipe(name: *u16, init: bool) -> libc::HANDLE { //////////////////////////////////////////////////////////////////////////////// pub struct UnixStream { - priv inner: UnsafeArc<Inner>, - priv write: Option<Event>, - priv read: Option<Event>, + inner: UnsafeArc<Inner>, + write: Option<Event>, + read: Option<Event>, } impl UnixStream { @@ -349,8 +349,8 @@ impl rtio::RtioPipe for UnixStream { //////////////////////////////////////////////////////////////////////////////// pub struct UnixListener { - priv handle: libc::HANDLE, - priv name: CString, + handle: libc::HANDLE, + name: CString, } impl UnixListener { @@ -389,8 +389,8 @@ impl rtio::RtioUnixListener for UnixListener { } pub struct UnixAcceptor { - priv listener: UnixListener, - priv event: Event, + listener: UnixListener, + event: Event, } impl UnixAcceptor { diff --git a/src/libnative/io/process.rs b/src/libnative/io/process.rs index b0f2495e98c..c729473eecd 100644 --- a/src/libnative/io/process.rs +++ b/src/libnative/io/process.rs @@ -31,15 +31,15 @@ use super::file; */ pub struct Process { /// The unique id of the process (this should never be negative). - priv pid: pid_t, + pid: pid_t, /// A handle to the process - on unix this will always be NULL, but on /// windows it will be a HANDLE to the process, which will prevent the /// pid being re-used until the handle is closed. - priv handle: *(), + handle: *(), /// None until finish() is called. - priv exit_code: Option<p::ProcessExit>, + exit_code: Option<p::ProcessExit>, } impl Process { diff --git a/src/libnative/io/timer_other.rs b/src/libnative/io/timer_other.rs index edd7af312c8..ea237944bad 100644 --- a/src/libnative/io/timer_other.rs +++ b/src/libnative/io/timer_other.rs @@ -59,8 +59,8 @@ use io::IoResult; use io::timer_helper; pub struct Timer { - priv id: uint, - priv inner: Option<~Inner>, + id: uint, + inner: Option<~Inner>, } struct Inner { diff --git a/src/libnative/io/timer_timerfd.rs b/src/libnative/io/timer_timerfd.rs index a8018bec0a6..d7202d9d765 100644 --- a/src/libnative/io/timer_timerfd.rs +++ b/src/libnative/io/timer_timerfd.rs @@ -40,8 +40,8 @@ use io::IoResult; use io::timer_helper; pub struct Timer { - priv fd: FileDesc, - priv on_worker: bool, + fd: FileDesc, + on_worker: bool, } #[allow(visible_private_types)] @@ -285,24 +285,24 @@ mod imp { #[cfg(target_arch = "x86_64")] #[packed] pub struct epoll_event { - events: u32, - data: i64, + pub events: u32, + pub data: i64, } #[cfg(not(target_arch = "x86_64"))] pub struct epoll_event { - events: u32, - data: i64, + pub events: u32, + pub data: i64, } pub struct timespec { - tv_sec: libc::time_t, - tv_nsec: libc::c_long, + pub tv_sec: libc::time_t, + pub tv_nsec: libc::c_long, } pub struct itimerspec { - it_interval: timespec, - it_value: timespec, + pub it_interval: timespec, + pub it_value: timespec, } extern { diff --git a/src/libnative/io/timer_win32.rs b/src/libnative/io/timer_win32.rs index cdfe2e0d033..a342afa6854 100644 --- a/src/libnative/io/timer_win32.rs +++ b/src/libnative/io/timer_win32.rs @@ -29,8 +29,8 @@ use io::timer_helper; use io::IoResult; pub struct Timer { - priv obj: libc::HANDLE, - priv on_worker: bool, + obj: libc::HANDLE, + on_worker: bool, } pub enum Req { diff --git a/src/libnative/lib.rs b/src/libnative/lib.rs index d06ca15f30c..06b51b56306 100644 --- a/src/libnative/lib.rs +++ b/src/libnative/lib.rs @@ -51,6 +51,8 @@ #![deny(unused_result, unused_must_use)] #![allow(non_camel_case_types)] +#![allow(visible_private_types)] // NOTE: remove after a stage0 snap + // NB this crate explicitly does *not* allow glob imports, please seriously // consider whether they're needed before adding that feature here (the // answer is that you don't need them) |
