Skip to content

Commit f0ee509

Browse files
committed
rustuv: Switch field privacy as necessary
1 parent fab0f47 commit f0ee509

File tree

11 files changed

+74
-74
lines changed

11 files changed

+74
-74
lines changed

src/librustuv/access.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ use std::rt::local::Local;
2222
use homing::HomingMissile;
2323

2424
pub struct Access {
25-
priv inner: UnsafeArc<Inner>,
25+
inner: UnsafeArc<Inner>,
2626
}
2727

2828
pub struct Guard<'a> {
29-
priv access: &'a mut Access,
30-
priv missile: Option<HomingMissile>,
29+
access: &'a mut Access,
30+
missile: Option<HomingMissile>,
3131
}
3232

3333
struct Inner {

src/librustuv/file.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ use uvll;
2626

2727
pub struct FsRequest {
2828
req: *uvll::uv_fs_t,
29-
priv fired: bool,
29+
fired: bool,
3030
}
3131

3232
pub struct FileWatcher {
33-
priv loop_: Loop,
34-
priv fd: c_int,
35-
priv close: rtio::CloseBehavior,
36-
priv home: HomeHandle,
33+
loop_: Loop,
34+
fd: c_int,
35+
close: rtio::CloseBehavior,
36+
home: HomeHandle,
3737
}
3838

3939
impl FsRequest {

src/librustuv/homing.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ use queue::{Queue, QueuePool};
4848
/// Handles are clone-able in order to derive new handles from existing handles
4949
/// (very useful for when accepting a socket from a server).
5050
pub struct HomeHandle {
51-
priv queue: Queue,
52-
priv id: uint,
51+
queue: Queue,
52+
id: uint,
5353
}
5454

5555
impl HomeHandle {
@@ -126,7 +126,7 @@ pub trait HomingIO {
126126
/// task back to its appropriate home (if applicable). The field is used to
127127
/// assert that we are where we think we are.
128128
pub struct HomingMissile {
129-
priv io_home: uint,
129+
io_home: uint,
130130
}
131131

132132
impl HomingMissile {

src/librustuv/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,8 @@ pub trait UvHandle<T> {
197197
}
198198

199199
pub struct ForbidSwitch {
200-
priv msg: &'static str,
201-
priv io: uint,
200+
msg: &'static str,
201+
io: uint,
202202
}
203203

204204
impl ForbidSwitch {
@@ -261,8 +261,8 @@ fn wakeup(slot: &mut Option<BlockedTask>) {
261261
}
262262

263263
pub struct Request {
264-
handle: *uvll::uv_req_t,
265-
priv defused: bool,
264+
pub handle: *uvll::uv_req_t,
265+
defused: bool,
266266
}
267267

268268
impl Request {
@@ -313,7 +313,7 @@ impl Drop for Request {
313313
/// with dtors may not be destructured, but tuple structs can,
314314
/// but the results are not correct.
315315
pub struct Loop {
316-
priv handle: *uvll::uv_loop_t
316+
handle: *uvll::uv_loop_t
317317
}
318318

319319
impl Loop {

src/librustuv/net.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -153,22 +153,22 @@ pub struct TcpWatcher {
153153
handle: *uvll::uv_tcp_t,
154154
stream: StreamWatcher,
155155
home: HomeHandle,
156-
priv refcount: Refcount,
156+
refcount: Refcount,
157157

158158
// libuv can't support concurrent reads and concurrent writes of the same
159159
// stream object, so we use these access guards in order to arbitrate among
160160
// multiple concurrent reads and writes. Note that libuv *can* read and
161161
// write simultaneously, it just can't read and read simultaneously.
162-
priv read_access: Access,
163-
priv write_access: Access,
162+
read_access: Access,
163+
write_access: Access,
164164
}
165165

166166
pub struct TcpListener {
167167
home: HomeHandle,
168168
handle: *uvll::uv_pipe_t,
169-
priv closing_task: Option<BlockedTask>,
170-
priv outgoing: Sender<Result<~rtio::RtioTcpStream:Send, IoError>>,
171-
priv incoming: Receiver<Result<~rtio::RtioTcpStream:Send, IoError>>,
169+
closing_task: Option<BlockedTask>,
170+
outgoing: Sender<Result<~rtio::RtioTcpStream:Send, IoError>>,
171+
incoming: Receiver<Result<~rtio::RtioTcpStream:Send, IoError>>,
172172
}
173173

174174
pub struct TcpAcceptor {
@@ -476,9 +476,9 @@ pub struct UdpWatcher {
476476
home: HomeHandle,
477477

478478
// See above for what these fields are
479-
priv refcount: Refcount,
480-
priv read_access: Access,
481-
priv write_access: Access,
479+
refcount: Refcount,
480+
read_access: Access,
481+
write_access: Access,
482482
}
483483

484484
impl UdpWatcher {

src/librustuv/pipe.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,19 @@ use uvll;
2626
pub struct PipeWatcher {
2727
stream: StreamWatcher,
2828
home: HomeHandle,
29-
priv defused: bool,
30-
priv refcount: Refcount,
29+
defused: bool,
30+
refcount: Refcount,
3131

3232
// see comments in TcpWatcher for why these exist
33-
priv write_access: Access,
34-
priv read_access: Access,
33+
write_access: Access,
34+
read_access: Access,
3535
}
3636

3737
pub struct PipeListener {
3838
home: HomeHandle,
3939
pipe: *uvll::uv_pipe_t,
40-
priv outgoing: Sender<Result<~RtioPipe:Send, IoError>>,
41-
priv incoming: Receiver<Result<~RtioPipe:Send, IoError>>,
40+
outgoing: Sender<Result<~RtioPipe:Send, IoError>>,
41+
incoming: Receiver<Result<~RtioPipe:Send, IoError>>,
4242
}
4343

4444
pub struct PipeAcceptor {

src/librustuv/queue.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,13 @@ struct State {
4646
/// This structure is intended to be stored next to the event loop, and it is
4747
/// used to create new `Queue` structures.
4848
pub struct QueuePool {
49-
priv queue: UnsafeArc<State>,
50-
priv refcnt: uint,
49+
queue: UnsafeArc<State>,
50+
refcnt: uint,
5151
}
5252

5353
/// This type is used to send messages back to the original event loop.
5454
pub struct Queue {
55-
priv queue: UnsafeArc<State>,
55+
queue: UnsafeArc<State>,
5656
}
5757

5858
extern fn async_cb(handle: *uvll::uv_async_t, status: c_int) {

src/librustuv/rc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
use std::sync::arc::UnsafeArc;
2020

2121
pub struct Refcount {
22-
priv rc: UnsafeArc<uint>,
22+
rc: UnsafeArc<uint>,
2323
}
2424

2525
impl Refcount {

src/librustuv/stream.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ use uvll;
2323
// uv_stream_t instance, and all I/O operations assume that it's already located
2424
// on the appropriate scheduler.
2525
pub struct StreamWatcher {
26-
handle: *uvll::uv_stream_t,
26+
pub handle: *uvll::uv_stream_t,
2727

2828
// Cache the last used uv_write_t so we don't have to allocate a new one on
2929
// every call to uv_write(). Ideally this would be a stack-allocated
3030
// structure, but currently we don't have mappings for all the structures
3131
// defined in libuv, so we're foced to malloc this.
32-
priv last_write_req: Option<Request>,
32+
last_write_req: Option<Request>,
3333
}
3434

3535
struct ReadContext {

src/librustuv/uvio.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ use uvll;
4646

4747
// Obviously an Event Loop is always home.
4848
pub struct UvEventLoop {
49-
priv uvio: UvIoFactory
49+
uvio: UvIoFactory
5050
}
5151

5252
impl UvEventLoop {
@@ -124,8 +124,8 @@ fn test_callback_run_once() {
124124
}
125125

126126
pub struct UvIoFactory {
127-
loop_: Loop,
128-
priv handle_pool: Option<~QueuePool>,
127+
pub loop_: Loop,
128+
handle_pool: Option<~QueuePool>,
129129
}
130130

131131
impl UvIoFactory {

src/librustuv/uvll.rs

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,15 @@ pub type uv_buf_len_t = libc::c_ulong;
100100
// see libuv/include/uv-unix.h
101101
#[cfg(unix)]
102102
pub struct uv_buf_t {
103-
base: *u8,
104-
len: uv_buf_len_t,
103+
pub base: *u8,
104+
pub len: uv_buf_len_t,
105105
}
106106

107107
// see libuv/include/uv-win.h
108108
#[cfg(windows)]
109109
pub struct uv_buf_t {
110-
len: uv_buf_len_t,
111-
base: *u8,
110+
pub len: uv_buf_len_t,
111+
pub base: *u8,
112112
}
113113

114114
#[repr(C)]
@@ -119,23 +119,23 @@ pub enum uv_run_mode {
119119
}
120120

121121
pub struct uv_process_options_t {
122-
exit_cb: uv_exit_cb,
123-
file: *libc::c_char,
124-
args: **libc::c_char,
125-
env: **libc::c_char,
126-
cwd: *libc::c_char,
127-
flags: libc::c_uint,
128-
stdio_count: libc::c_int,
129-
stdio: *uv_stdio_container_t,
130-
uid: uv_uid_t,
131-
gid: uv_gid_t,
122+
pub exit_cb: uv_exit_cb,
123+
pub file: *libc::c_char,
124+
pub args: **libc::c_char,
125+
pub env: **libc::c_char,
126+
pub cwd: *libc::c_char,
127+
pub flags: libc::c_uint,
128+
pub stdio_count: libc::c_int,
129+
pub stdio: *uv_stdio_container_t,
130+
pub uid: uv_uid_t,
131+
pub gid: uv_gid_t,
132132
}
133133

134134
// These fields are private because they must be interfaced with through the
135135
// functions below.
136136
pub struct uv_stdio_container_t {
137-
priv flags: libc::c_int,
138-
priv stream: *uv_stream_t,
137+
flags: libc::c_int,
138+
stream: *uv_stream_t,
139139
}
140140

141141
pub type uv_handle_t = c_void;
@@ -160,27 +160,27 @@ pub type uv_signal_t = c_void;
160160
pub type uv_shutdown_t = c_void;
161161

162162
pub struct uv_timespec_t {
163-
tv_sec: libc::c_long,
164-
tv_nsec: libc::c_long
163+
pub tv_sec: libc::c_long,
164+
pub tv_nsec: libc::c_long
165165
}
166166

167167
pub struct uv_stat_t {
168-
st_dev: libc::uint64_t,
169-
st_mode: libc::uint64_t,
170-
st_nlink: libc::uint64_t,
171-
st_uid: libc::uint64_t,
172-
st_gid: libc::uint64_t,
173-
st_rdev: libc::uint64_t,
174-
st_ino: libc::uint64_t,
175-
st_size: libc::uint64_t,
176-
st_blksize: libc::uint64_t,
177-
st_blocks: libc::uint64_t,
178-
st_flags: libc::uint64_t,
179-
st_gen: libc::uint64_t,
180-
st_atim: uv_timespec_t,
181-
st_mtim: uv_timespec_t,
182-
st_ctim: uv_timespec_t,
183-
st_birthtim: uv_timespec_t
168+
pub st_dev: libc::uint64_t,
169+
pub st_mode: libc::uint64_t,
170+
pub st_nlink: libc::uint64_t,
171+
pub st_uid: libc::uint64_t,
172+
pub st_gid: libc::uint64_t,
173+
pub st_rdev: libc::uint64_t,
174+
pub st_ino: libc::uint64_t,
175+
pub st_size: libc::uint64_t,
176+
pub st_blksize: libc::uint64_t,
177+
pub st_blocks: libc::uint64_t,
178+
pub st_flags: libc::uint64_t,
179+
pub st_gen: libc::uint64_t,
180+
pub st_atim: uv_timespec_t,
181+
pub st_mtim: uv_timespec_t,
182+
pub st_ctim: uv_timespec_t,
183+
pub st_birthtim: uv_timespec_t
184184
}
185185

186186
impl uv_stat_t {

0 commit comments

Comments
 (0)