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 {

0 commit comments

Comments
 (0)