native: Switch field privacy as necessary

This commit is contained in:
Alex Crichton 2014-03-27 15:10:28 -07:00
parent 5f33588d75
commit 14587f88ca
11 changed files with 39 additions and 37 deletions

View File

@ -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 {

View File

@ -34,7 +34,7 @@ struct Inner {
}
pub struct FileDesc {
priv inner: UnsafeArc<Inner>
inner: UnsafeArc<Inner>
}
impl FileDesc {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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)