auto merge of #9969 : reedlepee123/rust/priv_fields, r=bstrie

This commit is contained in:
bors 2013-10-22 15:31:26 -07:00
commit a7453ad0df
53 changed files with 216 additions and 214 deletions

View File

@ -521,15 +521,15 @@ fn borrow_rwlock<T:Freeze + Send>(state: *mut RWArcInner<T>) -> *RWLock {
/// The "write permission" token used for RWArc.write_downgrade().
pub struct RWWriteMode<'self, T> {
data: &'self mut T,
token: sync::RWLockWriteMode<'self>,
poison: PoisonOnFail,
priv data: &'self mut T,
priv token: sync::RWLockWriteMode<'self>,
priv poison: PoisonOnFail,
}
/// The "read permission" token used for RWArc.write_downgrade().
pub struct RWReadMode<'self, T> {
data: &'self T,
token: sync::RWLockReadMode<'self>,
priv data: &'self T,
priv token: sync::RWLockReadMode<'self>,
}
impl<'self, T:Freeze + Send> RWWriteMode<'self, T> {

View File

@ -22,11 +22,11 @@ pub enum CharacterSet {
/// Contains configuration parameters for `to_base64`.
pub struct Config {
/// Character set to use
char_set: CharacterSet,
priv char_set: CharacterSet,
/// True to pad output with `=` characters
pad: bool,
priv pad: bool,
/// `Some(len)` to wrap lines at `len`, `None` to disable line wrapping
line_length: Option<uint>
priv line_length: Option<uint>
}
/// Configuration for RFC 4648 standard base64 encoding

View File

@ -226,9 +226,9 @@ enum Op {Union, Intersect, Assign, Difference}
#[deriving(Clone)]
pub struct Bitv {
/// Internal representation of the bit vector (small or large)
rep: BitvVariant,
priv rep: BitvVariant,
/// The number of valid bits in the internal representation
nbits: uint
priv nbits: uint
}
fn die() -> ! {

View File

@ -50,7 +50,7 @@ impl Doc {
}
pub struct TaggedDoc {
tag: uint,
priv tag: uint,
doc: Doc,
}

View File

@ -155,7 +155,7 @@ struct FileInput_ {
// "self.fi" -> "self." and renaming FileInput_. Documentation above
// will likely have to be updated to use `let mut in = ...`.
pub struct FileInput {
fi: @mut FileInput_
priv fi: @mut FileInput_
}
impl FileInput {

View File

@ -119,7 +119,7 @@ pub struct Opt {
/// How often it can occur
occur: Occur,
/// Which options it aliases
aliases: ~[Opt],
priv aliases: ~[Opt],
}
/// Describes wether an option is given at all or has a value.
@ -134,9 +134,9 @@ enum Optval {
#[deriving(Clone, Eq)]
pub struct Matches {
/// Options that matched
opts: ~[Opt],
priv opts: ~[Opt],
/// Values of the Options that matched
vals: ~[~[Optval]],
priv vals: ~[~[Optval]],
/// Free string fragments
free: ~[~str]
}

View File

@ -480,13 +480,13 @@ pub struct MatchOptions {
* currently only considers upper/lower case relationships between ASCII characters,
* but in future this might be extended to work with Unicode.
*/
case_sensitive: bool,
priv case_sensitive: bool,
/**
* If this is true then path-component separator characters (e.g. `/` on Posix)
* must be matched by a literal `/`, rather than by `*` or `?` or `[...]`
*/
require_literal_separator: bool,
priv require_literal_separator: bool,
/**
* If this is true then paths that contain components that start with a `.` will
@ -494,7 +494,7 @@ pub struct MatchOptions {
* will not match. This is useful because such files are conventionally considered
* hidden on Unix systems and it might be desirable to skip them when listing files.
*/
require_literal_leading_dot: bool
priv require_literal_leading_dot: bool
}
impl MatchOptions {

View File

@ -17,9 +17,9 @@ use std::cast;
/// An implementation of the io::Reader interface which reads a buffer of bytes
pub struct BufReader {
/// The buffer of bytes to read
buf: ~[u8],
priv buf: ~[u8],
/// The current position in the buffer of bytes
pos: @mut uint
priv pos: @mut uint
}
impl BufReader {

View File

@ -49,11 +49,11 @@ pub type Object = TreeMap<~str, Json>;
/// returned
pub struct Error {
/// The line number at which the error occurred
line: uint,
priv line: uint,
/// The column number at which the error occurred
col: uint,
priv col: uint,
/// A message describing the type of the error
msg: @~str,
priv msg: @~str,
}
fn escape_str(s: &str) -> ~str {

View File

@ -20,8 +20,8 @@ use super::bigint::BigInt;
#[deriving(Clone)]
#[allow(missing_doc)]
pub struct Ratio<T> {
numer: T,
denom: T
priv numer: T,
priv denom: T
}
/// Alias for a `Ratio` of machine-sized integers.

View File

@ -71,17 +71,17 @@ impl ToStr for Identifier {
#[deriving(Clone, Eq)]
pub struct Version {
/// The major version, to be incremented on incompatible changes.
major: uint,
priv major: uint,
/// The minor version, to be incremented when functionality is added in a
/// backwards-compatible manner.
minor: uint,
priv minor: uint,
/// The patch version, to be incremented when backwards-compatible bug
/// fixes are made.
patch: uint,
priv patch: uint,
/// The pre-release version identifier, if one exists.
pre: ~[Identifier],
priv pre: ~[Identifier],
/// The build metadata, ignored when determining version precedence.
build: ~[Identifier],
priv build: ~[Identifier],
}
impl ToStr for Version {

View File

@ -105,18 +105,23 @@ pub trait Stats {
#[deriving(Clone, Eq)]
#[allow(missing_doc)]
pub struct Summary {
sum: f64,
priv sum: f64,
// public
min: f64,
// public
max: f64,
mean: f64,
priv mean: f64,
// public
median: f64,
var: f64,
std_dev: f64,
std_dev_pct: f64,
priv var: f64,
priv std_dev: f64,
priv std_dev_pct: f64,
// public
median_abs_dev: f64,
// public
median_abs_dev_pct: f64,
quartiles: (f64,f64,f64),
iqr: f64,
priv quartiles: (f64,f64,f64),
priv iqr: f64,
}
impl Summary {

View File

@ -376,8 +376,8 @@ impl Semaphore {
* A task which fails while holding a mutex will unlock the mutex as it
* unwinds.
*/
pub struct Mutex { priv sem: Sem<~[WaitQueue]> }
pub struct Mutex { priv sem: Sem<~[WaitQueue]> }
impl Clone for Mutex {
/// Create a new handle to the mutex.
fn clone(&self) -> Mutex { Mutex { sem: Sem((*self.sem).clone()) } }
@ -663,8 +663,8 @@ impl RWLock {
}
/// The "write permission" token used for rwlock.write_downgrade().
pub struct RWLockWriteMode<'self> { priv lock: &'self RWLock, priv token: NonCopyable }
pub struct RWLockWriteMode<'self> { priv lock: &'self RWLock, priv token: NonCopyable }
/// The "read permission" token used for rwlock.write_downgrade().
pub struct RWLockReadMode<'self> { priv lock: &'self RWLock,
priv token: NonCopyable }

View File

@ -28,8 +28,8 @@ enum Msg<T> {
}
pub struct TaskPool<T> {
channels: ~[Chan<Msg<T>>],
next_index: uint,
priv channels: ~[Chan<Msg<T>>],
priv next_index: uint,
}
#[unsafe_destructor]

View File

@ -95,14 +95,14 @@ fn cap_for_attr(attr: attr::Attr) -> &'static str {
#[cfg(not(target_os = "win32"))]
pub struct Terminal {
num_colors: u16,
priv num_colors: u16,
priv out: @io::Writer,
priv ti: ~TermInfo
}
#[cfg(target_os = "win32")]
pub struct Terminal {
num_colors: u16,
priv num_colors: u16,
priv out: @io::Writer,
}

View File

@ -48,9 +48,9 @@ pub enum Param {
/// Container for static and dynamic variable arrays
pub struct Variables {
/// Static variables A-Z
sta: [Param, ..26],
priv sta: [Param, ..26],
/// Dynamic variables a-z
dyn: [Param, ..26]
priv dyn: [Param, ..26]
}
impl Variables {

View File

@ -15,9 +15,9 @@ use std::hashmap::HashMap;
/// A parsed terminfo entry.
pub struct TermInfo {
/// Names for the terminal
names: ~[~str],
priv names: ~[~str],
/// Map of capability name to boolean value
bools: HashMap<~str, bool>,
priv bools: HashMap<~str, bool>,
/// Map of capability name to numeric value
numbers: HashMap<~str, u16>,
/// Map of capability name to raw (unexpanded) string

View File

@ -102,9 +102,9 @@ impl TestFn {
// Structure passed to BenchFns
pub struct BenchHarness {
iterations: u64,
ns_start: u64,
ns_end: u64,
priv iterations: u64,
priv ns_start: u64,
priv ns_end: u64,
bytes: u64
}
@ -124,8 +124,8 @@ pub struct TestDescAndFn {
#[deriving(Clone, Encodable, Decodable, Eq)]
pub struct Metric {
value: f64,
noise: f64
priv value: f64,
priv noise: f64
}
#[deriving(Eq)]
@ -322,8 +322,8 @@ pub fn opt_shard(maybestr: Option<~str>) -> Option<(uint,uint)> {
#[deriving(Clone, Eq)]
pub struct BenchSamples {
ns_iter_summ: stats::Summary,
mb_s: uint
priv ns_iter_summ: stats::Summary,
priv mb_s: uint
}
#[deriving(Clone, Eq)]

View File

@ -31,9 +31,10 @@ pub mod rustrt {
}
/// A record specifying a time value in seconds and nanoseconds.
#[deriving(Clone, DeepClone, Eq, Encodable, Decodable)]
pub struct Timespec { sec: i64, nsec: i32 }
#[deriving(Clone, DeepClone, Eq, Encodable, Decodable)]
pub struct Timespec { priv sec: i64, priv nsec: i32 }
/*
* Timespec assumes that pre-epoch Timespecs have negative sec and positive
* nsec fields. Darwin's and Linux's struct timespec functions handle pre-
@ -105,18 +106,18 @@ pub fn tzset() {
#[deriving(Clone, DeepClone, Eq, Encodable, Decodable)]
pub struct Tm {
tm_sec: i32, // seconds after the minute ~[0-60]
tm_min: i32, // minutes after the hour ~[0-59]
tm_hour: i32, // hours after midnight ~[0-23]
tm_mday: i32, // days of the month ~[1-31]
tm_mon: i32, // months since January ~[0-11]
tm_year: i32, // years since 1900
tm_wday: i32, // days since Sunday ~[0-6]
tm_yday: i32, // days since January 1 ~[0-365]
tm_isdst: i32, // Daylight Savings Time flag
tm_gmtoff: i32, // offset from UTC in seconds
tm_zone: ~str, // timezone abbreviation
tm_nsec: i32, // nanoseconds
priv tm_sec: i32, // seconds after the minute ~[0-60]
priv tm_min: i32, // minutes after the hour ~[0-59]
priv tm_hour: i32, // hours after midnight ~[0-23]
priv tm_mday: i32, // days of the month ~[1-31]
priv tm_mon: i32, // months since January ~[0-11]
priv tm_year: i32, // years since 1900
priv tm_wday: i32, // days since Sunday ~[0-6]
priv tm_yday: i32, // days since January 1 ~[0-365]
priv tm_isdst: i32, // Daylight Savings Time flag
priv tm_gmtoff: i32, // offset from UTC in seconds
priv tm_zone: ~str, // timezone abbreviation
priv tm_nsec: i32, // nanoseconds
}
pub fn empty_tm() -> Tm {

View File

@ -128,8 +128,8 @@ impl WorkMap {
}
pub struct Database {
db_filename: Path,
db_cache: TreeMap<~str, ~str>,
priv db_filename: Path,
priv db_cache: TreeMap<~str, ~str>,
db_dirty: bool
}
@ -209,7 +209,7 @@ impl Drop for Database {
pub struct Logger {
// FIXME #4432: Fill in
a: ()
priv a: ()
}
impl Logger {
@ -228,26 +228,26 @@ pub type FreshnessMap = TreeMap<~str,extern fn(&str,&str)->bool>;
#[deriving(Clone)]
pub struct Context {
db: RWArc<Database>,
logger: RWArc<Logger>,
cfg: Arc<json::Object>,
priv logger: RWArc<Logger>,
priv cfg: Arc<json::Object>,
/// Map from kinds (source, exe, url, etc.) to a freshness function.
/// The freshness function takes a name (e.g. file path) and value
/// (e.g. hash of file contents) and determines whether it's up-to-date.
/// For example, in the file case, this would read the file off disk,
/// hash it, and return the result of comparing the given hash and the
/// read hash for equality.
freshness: Arc<FreshnessMap>
priv freshness: Arc<FreshnessMap>
}
pub struct Prep<'self> {
ctxt: &'self Context,
fn_name: &'self str,
declared_inputs: WorkMap,
priv ctxt: &'self Context,
priv fn_name: &'self str,
priv declared_inputs: WorkMap,
}
pub struct Exec {
discovered_inputs: WorkMap,
discovered_outputs: WorkMap
priv discovered_inputs: WorkMap,
priv discovered_outputs: WorkMap
}
enum Work<'self, T> {

View File

@ -490,7 +490,6 @@ pub struct Formatter<'self> {
/// Output buffer.
buf: &'self mut io::Writer,
priv curarg: vec::VecIterator<'self, Argument<'self>>,
priv args: &'self [Argument<'self>],
}

View File

@ -1009,7 +1009,7 @@ impl<R:Reader,C> Reader for Wrapper<R, C> {
}
pub struct FILERes {
f: *libc::FILE,
priv f: *libc::FILE,
}
impl FILERes {
@ -1282,7 +1282,7 @@ impl Writer for fd_t {
}
pub struct FdRes {
fd: fd_t,
priv fd: fd_t,
}
impl FdRes {
@ -1792,7 +1792,7 @@ pub mod fsync {
// Artifacts that need to fsync on destruction
pub struct Res<t> {
arg: Arg<t>,
priv arg: Arg<t>,
}
impl <t> Res<t> {
@ -1815,9 +1815,9 @@ pub mod fsync {
}
pub struct Arg<t> {
val: t,
opt_level: Option<Level>,
fsync_fn: extern "Rust" fn(f: &t, Level) -> int,
priv val: t,
priv opt_level: Option<Level>,
priv fsync_fn: extern "Rust" fn(f: &t, Level) -> int,
}
// fsync file after executing blk

View File

@ -1790,9 +1790,9 @@ impl<'self, A, St> Iterator<A> for Unfold<'self, A, St> {
#[deriving(Clone)]
pub struct Counter<A> {
/// The current state the counter is at (next value to be yielded)
state: A,
priv state: A,
/// The amount that this iterator is stepping by
step: A
priv step: A
}
/// Creates a new counter with the specified start/step

View File

@ -41,7 +41,7 @@ pub fn align(size: uint, align: uint) -> uint {
/// Adaptor to wrap around visitors implementing MovePtr.
pub struct MovePtrAdaptor<V> {
inner: V
priv inner: V
}
pub fn MovePtrAdaptor<V:TyVisitor + MovePtr>(v: V) -> MovePtrAdaptor<V> {
MovePtrAdaptor { inner: v }

View File

@ -98,10 +98,10 @@ enum VariantState {
}
pub struct ReprVisitor<'self> {
ptr: *c_void,
ptr_stk: ~[*c_void],
var_stk: ~[VariantState],
writer: &'self mut io::Writer
priv ptr: *c_void,
priv ptr_stk: ~[*c_void],
priv var_stk: ~[VariantState],
priv writer: &'self mut io::Writer
}
pub fn ReprVisitor<'a>(ptr: *c_void,

View File

@ -29,9 +29,9 @@ static ALL_BITS: uint = FROZEN_BIT | MUT_BIT;
#[deriving(Eq)]
pub struct BorrowRecord {
box: *mut raw::Box<()>,
priv box: *mut raw::Box<()>,
file: *c_char,
line: size_t
priv line: size_t
}
fn try_take_task_borrow_list() -> Option<~[BorrowRecord]> {

View File

@ -48,14 +48,14 @@ struct Packet<T> {
// A one-shot channel.
pub struct ChanOne<T> {
void_packet: *mut Void,
suppress_finalize: bool
priv void_packet: *mut Void,
priv suppress_finalize: bool
}
/// A one-shot port.
pub struct PortOne<T> {
void_packet: *mut Void,
suppress_finalize: bool
priv void_packet: *mut Void,
priv suppress_finalize: bool
}
pub fn oneshot<T: Send>() -> (PortOne<T>, ChanOne<T>) {

View File

@ -25,11 +25,11 @@ pub static RED_ZONE: uint = 20 * 1024;
// then misalign the regs again.
pub struct Context {
/// The context entry point, saved here for later destruction
start: Option<~~fn()>,
priv start: Option<~~fn()>,
/// Hold the registers while the task or scheduler is suspended
regs: ~Registers,
priv regs: ~Registers,
/// Lower bound and upper bound for the stack
stack_bounds: Option<(uint, uint)>,
priv stack_bounds: Option<(uint, uint)>,
}
impl Context {

View File

@ -26,9 +26,9 @@ pub struct ModEntry<'self> {
}
pub struct CrateMap<'self> {
version: i32,
entries: &'self [ModEntry<'self>],
children: &'self [&'self CrateMap<'self>]
priv version: i32,
priv entries: &'self [ModEntry<'self>],
priv children: &'self [&'self CrateMap<'self>]
}
#[cfg(not(windows))]

View File

@ -362,8 +362,8 @@ impl Seek for FileWriter {
/// For this reason, it is best to use the access-constrained wrappers that are
/// exposed via `FileInfo.open_reader()` and `FileInfo.open_writer()`.
pub struct FileStream {
fd: ~RtioFileStream,
last_nread: int,
priv fd: ~RtioFileStream,
priv last_nread: int,
}
/// a `std::rt::io::Reader` trait impl for file I/O.

View File

@ -17,7 +17,7 @@ use super::*;
/// A Writer decorator that compresses using the 'deflate' scheme
pub struct DeflateWriter<W> {
inner_writer: W
priv inner_writer: W
}
impl<W: Writer> DeflateWriter<W> {
@ -56,7 +56,7 @@ impl<W: Writer> Decorator<W> for DeflateWriter<W> {
/// A Reader decorator that decompresses using the 'deflate' scheme
pub struct InflateReader<R> {
inner_reader: R
priv inner_reader: R
}
impl<R: Reader> InflateReader<R> {

View File

@ -13,7 +13,7 @@ use rt::io::{Reader, Writer};
pub struct MockReader {
read: ~fn(buf: &mut [u8]) -> Option<uint>,
eof: ~fn() -> bool
priv eof: ~fn() -> bool
}
impl MockReader {
@ -31,8 +31,8 @@ impl Reader for MockReader {
}
pub struct MockWriter {
write: ~fn(buf: &[u8]),
flush: ~fn()
priv write: ~fn(buf: &[u8]),
priv flush: ~fn()
}
impl MockWriter {

View File

@ -219,17 +219,17 @@ pub struct Death {
// might kill it. This is optional so we can take it by-value at exit time.
kill_handle: Option<KillHandle>,
// Handle to a watching parent, if we have one, for exit code propagation.
watching_parent: Option<KillHandle>,
priv watching_parent: Option<KillHandle>,
// Action to be done with the exit code. If set, also makes the task wait
// until all its watched children exit before collecting the status.
on_exit: Option<~fn(bool)>,
// nesting level counter for task::unkillable calls (0 == killable).
unkillable: int,
priv unkillable: int,
// nesting level counter for unstable::atomically calls (0 == can deschedule).
wont_sleep: int,
priv wont_sleep: int,
// A "spare" handle to the kill flag inside the kill handle. Used during
// blocking/waking as an optimization to avoid two xadds on the refcount.
spare_kill_flag: Option<KillFlagHandle>,
priv spare_kill_flag: Option<KillFlagHandle>,
}
impl Drop for KillFlag {

View File

@ -32,8 +32,8 @@ pub type OpaqueBox = c_void;
pub type TypeDesc = c_void;
pub struct LocalHeap {
memory_region: *MemoryRegion,
boxed_region: *BoxedRegion
priv memory_region: *MemoryRegion,
priv boxed_region: *BoxedRegion
}
impl LocalHeap {

View File

@ -24,7 +24,7 @@ use libc::c_void;
use cast;
pub struct RC<T> {
p: *c_void // ~(uint, T)
priv p: *c_void // ~(uint, T)
}
impl<T> RC<T> {

View File

@ -66,7 +66,7 @@ pub struct FileOpenConfig {
/// Flags for file access mode (as per open(2))
flags: int,
/// File creation mode, ignored unless O_CREAT is passed as part of flags
mode: int
priv mode: int
}
pub trait IoFactory {

View File

@ -66,26 +66,26 @@ pub struct Scheduler {
event_loop: ~EventLoopObject,
/// The scheduler runs on a special task. When it is not running
/// it is stored here instead of the work queue.
sched_task: Option<~Task>,
priv sched_task: Option<~Task>,
/// An action performed after a context switch on behalf of the
/// code running before the context switch
cleanup_job: Option<CleanupJob>,
priv cleanup_job: Option<CleanupJob>,
/// Should this scheduler run any task, or only pinned tasks?
run_anything: bool,
/// If the scheduler shouldn't run some tasks, a friend to send
/// them to.
friend_handle: Option<SchedHandle>,
priv friend_handle: Option<SchedHandle>,
/// A fast XorShift rng for scheduler use
rng: XorShiftRng,
/// A toggleable idle callback
idle_callback: Option<~PausibleIdleCallback>,
priv idle_callback: Option<~PausibleIdleCallback>,
/// A countdown that starts at a random value and is decremented
/// every time a yield check is performed. When it hits 0 a task
/// will yield.
yield_check_count: uint,
priv yield_check_count: uint,
/// A flag to tell the scheduler loop it needs to do some stealing
/// in order to introduce randomness as part of a yield
steal_for_yield: bool
priv steal_for_yield: bool
}
/// An indication of how hard to work on a given operation, the difference

View File

@ -15,8 +15,8 @@ use ops::Drop;
use libc::{c_uint, uintptr_t};
pub struct StackSegment {
buf: ~[u8],
valgrind_id: c_uint
priv buf: ~[u8],
priv valgrind_id: c_uint
}
impl StackSegment {

View File

@ -44,7 +44,7 @@ use send_str::SendStr;
pub struct Task {
heap: LocalHeap,
gc: GarbageCollector,
priv gc: GarbageCollector,
storage: LocalStorage,
logger: StdErrLogger,
unwinder: Unwinder,
@ -69,7 +69,7 @@ pub struct Coroutine {
/// The segment of stack on which the task is currently running or
/// if the task is blocked, on which the task will resume
/// execution.
current_stack_segment: StackSegment,
priv current_stack_segment: StackSegment,
/// Always valid if the task is alive and not running.
saved_context: Context
}

View File

@ -18,9 +18,9 @@ use uint;
type raw_thread = libc::c_void;
pub struct Thread {
main: ~fn(),
raw_thread: *raw_thread,
joined: bool,
priv main: ~fn(),
priv raw_thread: *raw_thread,
priv joined: bool
}
impl Thread {

View File

@ -28,7 +28,7 @@ struct TubeState<T> {
}
pub struct Tube<T> {
p: RC<TubeState<T>>
priv p: RC<TubeState<T>>
}
impl<T> Tube<T> {

View File

@ -25,7 +25,7 @@ type GetAddrInfoCallback = ~fn(GetAddrInfoRequest, &UvAddrInfo, Option<UvError>)
pub struct GetAddrInfoRequest(*uvll::uv_getaddrinfo_t);
pub struct RequestData {
getaddrinfo_cb: Option<GetAddrInfoCallback>,
priv getaddrinfo_cb: Option<GetAddrInfoCallback>,
}
impl GetAddrInfoRequest {

View File

@ -25,7 +25,7 @@ pub struct FsRequest(*uvll::uv_fs_t);
impl Request for FsRequest {}
pub struct RequestData {
complete_cb: Option<FsCallback>
priv complete_cb: Option<FsCallback>
}
impl FsRequest {

View File

@ -80,7 +80,7 @@ pub mod pipe;
/// with dtors may not be destructured, but tuple structs can,
/// but the results are not correct.
pub struct Loop {
handle: *uvll::uv_loop_t
priv handle: *uvll::uv_loop_t
}
/// The trait implemented by uv 'watchers' (handles). Watchers are

View File

@ -180,7 +180,7 @@ fn socket_name<T, U: Watcher + NativeHandle<*T>>(sk: SocketNameKind,
// Obviously an Event Loop is always home.
pub struct UvEventLoop {
uvio: UvIoFactory
priv uvio: UvIoFactory
}
impl UvEventLoop {
@ -240,9 +240,9 @@ impl EventLoop for UvEventLoop {
}
pub struct UvPausibleIdleCallback {
watcher: IdleWatcher,
idle_flag: bool,
closed: bool
priv watcher: IdleWatcher,
priv idle_flag: bool,
priv closed: bool
}
impl UvPausibleIdleCallback {
@ -294,10 +294,10 @@ fn test_callback_run_once() {
// The entire point of async is to call into a loop from other threads so it does not need to home.
pub struct UvRemoteCallback {
// The uv async handle for triggering the callback
async: AsyncWatcher,
priv async: AsyncWatcher,
// A flag to tell the callback to exit, set from the dtor. This is
// almost never contested - only in rare races with the dtor.
exit_flag: Exclusive<bool>
priv exit_flag: Exclusive<bool>
}
impl UvRemoteCallback {
@ -801,8 +801,8 @@ impl IoFactory for UvIoFactory {
}
pub struct UvTcpListener {
watcher : TcpWatcher,
home: SchedHandle,
priv watcher : TcpWatcher,
priv home: SchedHandle,
}
impl HomingIO for UvTcpListener {
@ -863,8 +863,8 @@ impl RtioTcpListener for UvTcpListener {
}
pub struct UvTcpAcceptor {
listener: UvTcpListener,
incoming: Tube<Result<~RtioTcpStreamObject, IoError>>,
priv listener: UvTcpListener,
priv incoming: Tube<Result<~RtioTcpStreamObject, IoError>>,
}
impl HomingIO for UvTcpAcceptor {
@ -988,7 +988,7 @@ fn write_stream(mut watcher: StreamWatcher,
pub struct UvUnboundPipe {
pipe: Pipe,
home: SchedHandle,
priv home: SchedHandle,
}
impl HomingIO for UvUnboundPipe {
@ -1040,8 +1040,8 @@ impl RtioPipe for UvPipeStream {
}
pub struct UvTcpStream {
watcher: TcpWatcher,
home: SchedHandle,
priv watcher: TcpWatcher,
priv home: SchedHandle,
}
impl HomingIO for UvTcpStream {
@ -1140,8 +1140,8 @@ impl RtioTcpStream for UvTcpStream {
}
pub struct UvUdpSocket {
watcher: UdpWatcher,
home: SchedHandle,
priv watcher: UdpWatcher,
priv home: SchedHandle,
}
impl HomingIO for UvUdpSocket {
@ -1350,8 +1350,8 @@ impl RtioUdpSocket for UvUdpSocket {
}
pub struct UvTimer {
watcher: timer::TimerWatcher,
home: SchedHandle,
priv watcher: timer::TimerWatcher,
priv home: SchedHandle,
}
impl HomingIO for UvTimer {
@ -1397,10 +1397,10 @@ impl RtioTimer for UvTimer {
}
pub struct UvFileStream {
loop_: Loop,
fd: c_int,
close_on_drop: bool,
home: SchedHandle
priv loop_: Loop,
priv fd: c_int,
priv close_on_drop: bool,
priv home: SchedHandle
}
impl HomingIO for UvFileStream {
@ -1530,11 +1530,11 @@ impl RtioFileStream for UvFileStream {
}
pub struct UvProcess {
process: process::Process,
priv process: process::Process,
// Sadly, this structure must be created before we return it, so in that
// brief interim the `home` is None.
home: Option<SchedHandle>,
priv home: Option<SchedHandle>,
// All None until the process exits (exit_error may stay None)
priv exit_status: Option<int>,

View File

@ -134,26 +134,26 @@ pub type uv_pipe_t = c_void;
pub struct uv_timespec_t {
tv_sec: libc::c_long,
tv_nsec: libc::c_long
priv tv_nsec: libc::c_long
}
pub struct uv_stat_t {
st_dev: libc::uint64_t,
priv st_dev: libc::uint64_t,
st_mode: libc::uint64_t,
st_nlink: libc::uint64_t,
st_uid: libc::uint64_t,
st_gid: libc::uint64_t,
st_rdev: libc::uint64_t,
st_ino: libc::uint64_t,
priv st_nlink: libc::uint64_t,
priv st_uid: libc::uint64_t,
priv st_gid: libc::uint64_t,
priv st_rdev: libc::uint64_t,
priv st_ino: libc::uint64_t,
st_size: libc::uint64_t,
st_blksize: libc::uint64_t,
st_blocks: libc::uint64_t,
st_flags: libc::uint64_t,
st_gen: libc::uint64_t,
priv st_blksize: libc::uint64_t,
priv st_blocks: libc::uint64_t,
priv st_flags: libc::uint64_t,
priv st_gen: libc::uint64_t,
st_atim: uv_timespec_t,
st_mtim: uv_timespec_t,
st_ctim: uv_timespec_t,
st_birthtim: uv_timespec_t
priv st_birthtim: uv_timespec_t
}
impl uv_stat_t {
@ -231,37 +231,37 @@ pub type socklen_t = c_int;
#[cfg(target_os = "android")]
#[cfg(target_os = "linux")]
pub struct addrinfo {
ai_flags: c_int,
ai_family: c_int,
ai_socktype: c_int,
ai_protocol: c_int,
ai_addrlen: socklen_t,
priv ai_flags: c_int,
priv ai_family: c_int,
priv ai_socktype: c_int,
priv ai_protocol: c_int,
priv ai_addrlen: socklen_t,
ai_addr: *sockaddr,
ai_canonname: *char,
priv ai_canonname: *char,
ai_next: *addrinfo
}
#[cfg(target_os = "macos")]
#[cfg(target_os = "freebsd")]
pub struct addrinfo {
ai_flags: c_int,
ai_family: c_int,
ai_socktype: c_int,
ai_protocol: c_int,
ai_addrlen: socklen_t,
ai_canonname: *char,
priv ai_flags: c_int,
priv ai_family: c_int,
priv ai_socktype: c_int,
priv ai_protocol: c_int,
priv ai_addrlen: socklen_t,
priv ai_canonname: *char,
ai_addr: *sockaddr,
ai_next: *addrinfo
}
#[cfg(windows)]
pub struct addrinfo {
ai_flags: c_int,
ai_family: c_int,
ai_socktype: c_int,
ai_protocol: c_int,
ai_addrlen: size_t,
ai_canonname: *char,
priv ai_flags: c_int,
priv ai_family: c_int,
priv ai_socktype: c_int,
priv ai_protocol: c_int,
priv ai_addrlen: size_t,
priv ai_canonname: *char,
ai_addr: *sockaddr,
ai_next: *addrinfo
}
@ -960,8 +960,8 @@ pub unsafe fn freeaddrinfo(ai: *addrinfo) {
}
pub struct uv_err_data {
err_name: ~str,
err_msg: ~str,
priv err_name: ~str,
priv err_msg: ~str,
}
extern {

View File

@ -34,7 +34,6 @@ pub struct Process {
/// Options that can be given when starting a Process.
pub struct ProcessOptions<'self> {
/**
* If this is None then the new process will have the same initial
* environment as the parent process.
@ -99,7 +98,6 @@ impl <'self> ProcessOptions<'self> {
/// The output of a finished process.
pub struct ProcessOutput {
/// The status (exit code) of the process.
status: int,

View File

@ -998,7 +998,6 @@ pub fn utf8_char_width(b: u8) -> uint {
pub struct CharRange {
/// Current `char`
ch: char,
/// Index of the first byte of the next `char`
next: uint
}

View File

@ -108,7 +108,7 @@ pub enum SchedMode {
*
*/
pub struct SchedOpts {
mode: SchedMode,
priv mode: SchedMode,
}
/**
@ -144,11 +144,11 @@ pub struct SchedOpts {
* scheduler other tasks will be impeded or even blocked indefinitely.
*/
pub struct TaskOpts {
linked: bool,
supervised: bool,
watched: bool,
indestructible: bool,
notify_chan: Option<Chan<TaskResult>>,
priv linked: bool,
priv supervised: bool,
priv watched: bool,
priv indestructible: bool,
priv notify_chan: Option<Chan<TaskResult>>,
name: Option<SendStr>,
sched: SchedOpts,
stack_size: Option<uint>
@ -170,9 +170,9 @@ pub struct TaskOpts {
// FIXME (#3724): Replace the 'consumed' bit with move mode on self
pub struct TaskBuilder {
opts: TaskOpts,
gen_body: Option<~fn(v: ~fn()) -> ~fn()>,
can_not_copy: Option<util::NonCopyable>,
consumed: bool,
priv gen_body: Option<~fn(v: ~fn()) -> ~fn()>,
priv can_not_copy: Option<util::NonCopyable>,
priv consumed: bool,
}
/**

View File

@ -308,10 +308,10 @@ fn each_ancestor(list: &mut AncestorList,
// One of these per task.
pub struct Taskgroup {
// List of tasks with whose fates this one's is intertwined.
tasks: TaskGroupArc, // 'none' means the group has failed.
priv tasks: TaskGroupArc, // 'none' means the group has failed.
// Lists of tasks who will kill us if they fail, but whom we won't kill.
ancestors: AncestorList,
notifier: Option<AutoNotify>,
priv ancestors: AncestorList,
priv notifier: Option<AutoNotify>,
}
impl Drop for Taskgroup {

View File

@ -49,23 +49,23 @@ pub struct TyDesc {
align: uint,
// Called on a copy of a value of type `T` *after* memcpy
take_glue: GlueFn,
priv take_glue: GlueFn,
// Called when a value of type `T` is no longer needed
drop_glue: GlueFn,
// Called by drop glue when a value of type `T` can be freed
free_glue: GlueFn,
priv free_glue: GlueFn,
// Called by reflection visitor to visit a value of type `T`
visit_glue: GlueFn,
priv visit_glue: GlueFn,
// If T represents a box pointer (`@U` or `~U`), then
// `borrow_offset` is the amount that the pointer must be adjusted
// to find the payload. This is always derivable from the type
// `U`, but in the case of `@Trait` or `~Trait` objects, the type
// `U` is unknown.
borrow_offset: uint,
priv borrow_offset: uint,
// Name corresponding to the type
name: &'static str

View File

@ -15,7 +15,7 @@ use unstable::intrinsics::TyDesc;
pub struct Box<T> {
ref_count: uint,
type_desc: *TyDesc,
prev: *Box<T>,
priv prev: *Box<T>,
next: *Box<T>,
data: T
}

View File

@ -304,7 +304,7 @@ pub unsafe fn atomically<U>(f: &fn() -> U) -> U {
type rust_little_lock = *libc::c_void;
pub struct LittleLock {
l: rust_little_lock,
priv l: rust_little_lock,
}
impl Drop for LittleLock {
@ -353,7 +353,7 @@ struct ExData<T> {
* need to block or deschedule while accessing shared state, use extra::sync::RWArc.
*/
pub struct Exclusive<T> {
x: UnsafeArc<ExData<T>>
priv x: UnsafeArc<ExData<T>>
}
impl<T:Send> Clone for Exclusive<T> {