auto merge of #9969 : reedlepee123/rust/priv_fields, r=bstrie
This commit is contained in:
commit
a7453ad0df
53 changed files with 216 additions and 214 deletions
|
@ -521,15 +521,15 @@ fn borrow_rwlock<T:Freeze + Send>(state: *mut RWArcInner<T>) -> *RWLock {
|
||||||
|
|
||||||
/// The "write permission" token used for RWArc.write_downgrade().
|
/// The "write permission" token used for RWArc.write_downgrade().
|
||||||
pub struct RWWriteMode<'self, T> {
|
pub struct RWWriteMode<'self, T> {
|
||||||
data: &'self mut T,
|
priv data: &'self mut T,
|
||||||
token: sync::RWLockWriteMode<'self>,
|
priv token: sync::RWLockWriteMode<'self>,
|
||||||
poison: PoisonOnFail,
|
priv poison: PoisonOnFail,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The "read permission" token used for RWArc.write_downgrade().
|
/// The "read permission" token used for RWArc.write_downgrade().
|
||||||
pub struct RWReadMode<'self, T> {
|
pub struct RWReadMode<'self, T> {
|
||||||
data: &'self T,
|
priv data: &'self T,
|
||||||
token: sync::RWLockReadMode<'self>,
|
priv token: sync::RWLockReadMode<'self>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'self, T:Freeze + Send> RWWriteMode<'self, T> {
|
impl<'self, T:Freeze + Send> RWWriteMode<'self, T> {
|
||||||
|
|
|
@ -22,11 +22,11 @@ pub enum CharacterSet {
|
||||||
/// Contains configuration parameters for `to_base64`.
|
/// Contains configuration parameters for `to_base64`.
|
||||||
pub struct Config {
|
pub struct Config {
|
||||||
/// Character set to use
|
/// Character set to use
|
||||||
char_set: CharacterSet,
|
priv char_set: CharacterSet,
|
||||||
/// True to pad output with `=` characters
|
/// True to pad output with `=` characters
|
||||||
pad: bool,
|
priv pad: bool,
|
||||||
/// `Some(len)` to wrap lines at `len`, `None` to disable line wrapping
|
/// `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
|
/// Configuration for RFC 4648 standard base64 encoding
|
||||||
|
|
|
@ -226,9 +226,9 @@ enum Op {Union, Intersect, Assign, Difference}
|
||||||
#[deriving(Clone)]
|
#[deriving(Clone)]
|
||||||
pub struct Bitv {
|
pub struct Bitv {
|
||||||
/// Internal representation of the bit vector (small or large)
|
/// Internal representation of the bit vector (small or large)
|
||||||
rep: BitvVariant,
|
priv rep: BitvVariant,
|
||||||
/// The number of valid bits in the internal representation
|
/// The number of valid bits in the internal representation
|
||||||
nbits: uint
|
priv nbits: uint
|
||||||
}
|
}
|
||||||
|
|
||||||
fn die() -> ! {
|
fn die() -> ! {
|
||||||
|
|
|
@ -50,7 +50,7 @@ impl Doc {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct TaggedDoc {
|
pub struct TaggedDoc {
|
||||||
tag: uint,
|
priv tag: uint,
|
||||||
doc: Doc,
|
doc: Doc,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -155,7 +155,7 @@ struct FileInput_ {
|
||||||
// "self.fi" -> "self." and renaming FileInput_. Documentation above
|
// "self.fi" -> "self." and renaming FileInput_. Documentation above
|
||||||
// will likely have to be updated to use `let mut in = ...`.
|
// will likely have to be updated to use `let mut in = ...`.
|
||||||
pub struct FileInput {
|
pub struct FileInput {
|
||||||
fi: @mut FileInput_
|
priv fi: @mut FileInput_
|
||||||
}
|
}
|
||||||
|
|
||||||
impl FileInput {
|
impl FileInput {
|
||||||
|
|
|
@ -119,7 +119,7 @@ pub struct Opt {
|
||||||
/// How often it can occur
|
/// How often it can occur
|
||||||
occur: Occur,
|
occur: Occur,
|
||||||
/// Which options it aliases
|
/// Which options it aliases
|
||||||
aliases: ~[Opt],
|
priv aliases: ~[Opt],
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Describes wether an option is given at all or has a value.
|
/// Describes wether an option is given at all or has a value.
|
||||||
|
@ -134,9 +134,9 @@ enum Optval {
|
||||||
#[deriving(Clone, Eq)]
|
#[deriving(Clone, Eq)]
|
||||||
pub struct Matches {
|
pub struct Matches {
|
||||||
/// Options that matched
|
/// Options that matched
|
||||||
opts: ~[Opt],
|
priv opts: ~[Opt],
|
||||||
/// Values of the Options that matched
|
/// Values of the Options that matched
|
||||||
vals: ~[~[Optval]],
|
priv vals: ~[~[Optval]],
|
||||||
/// Free string fragments
|
/// Free string fragments
|
||||||
free: ~[~str]
|
free: ~[~str]
|
||||||
}
|
}
|
||||||
|
|
|
@ -480,13 +480,13 @@ pub struct MatchOptions {
|
||||||
* currently only considers upper/lower case relationships between ASCII characters,
|
* currently only considers upper/lower case relationships between ASCII characters,
|
||||||
* but in future this might be extended to work with Unicode.
|
* 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)
|
* If this is true then path-component separator characters (e.g. `/` on Posix)
|
||||||
* must be matched by a literal `/`, rather than by `*` or `?` or `[...]`
|
* 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
|
* 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
|
* 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.
|
* 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 {
|
impl MatchOptions {
|
||||||
|
|
|
@ -17,9 +17,9 @@ use std::cast;
|
||||||
/// An implementation of the io::Reader interface which reads a buffer of bytes
|
/// An implementation of the io::Reader interface which reads a buffer of bytes
|
||||||
pub struct BufReader {
|
pub struct BufReader {
|
||||||
/// The buffer of bytes to read
|
/// The buffer of bytes to read
|
||||||
buf: ~[u8],
|
priv buf: ~[u8],
|
||||||
/// The current position in the buffer of bytes
|
/// The current position in the buffer of bytes
|
||||||
pos: @mut uint
|
priv pos: @mut uint
|
||||||
}
|
}
|
||||||
|
|
||||||
impl BufReader {
|
impl BufReader {
|
||||||
|
|
|
@ -49,11 +49,11 @@ pub type Object = TreeMap<~str, Json>;
|
||||||
/// returned
|
/// returned
|
||||||
pub struct Error {
|
pub struct Error {
|
||||||
/// The line number at which the error occurred
|
/// The line number at which the error occurred
|
||||||
line: uint,
|
priv line: uint,
|
||||||
/// The column number at which the error occurred
|
/// The column number at which the error occurred
|
||||||
col: uint,
|
priv col: uint,
|
||||||
/// A message describing the type of the error
|
/// A message describing the type of the error
|
||||||
msg: @~str,
|
priv msg: @~str,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn escape_str(s: &str) -> ~str {
|
fn escape_str(s: &str) -> ~str {
|
||||||
|
|
|
@ -20,8 +20,8 @@ use super::bigint::BigInt;
|
||||||
#[deriving(Clone)]
|
#[deriving(Clone)]
|
||||||
#[allow(missing_doc)]
|
#[allow(missing_doc)]
|
||||||
pub struct Ratio<T> {
|
pub struct Ratio<T> {
|
||||||
numer: T,
|
priv numer: T,
|
||||||
denom: T
|
priv denom: T
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Alias for a `Ratio` of machine-sized integers.
|
/// Alias for a `Ratio` of machine-sized integers.
|
||||||
|
|
|
@ -71,17 +71,17 @@ impl ToStr for Identifier {
|
||||||
#[deriving(Clone, Eq)]
|
#[deriving(Clone, Eq)]
|
||||||
pub struct Version {
|
pub struct Version {
|
||||||
/// The major version, to be incremented on incompatible changes.
|
/// 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
|
/// The minor version, to be incremented when functionality is added in a
|
||||||
/// backwards-compatible manner.
|
/// backwards-compatible manner.
|
||||||
minor: uint,
|
priv minor: uint,
|
||||||
/// The patch version, to be incremented when backwards-compatible bug
|
/// The patch version, to be incremented when backwards-compatible bug
|
||||||
/// fixes are made.
|
/// fixes are made.
|
||||||
patch: uint,
|
priv patch: uint,
|
||||||
/// The pre-release version identifier, if one exists.
|
/// The pre-release version identifier, if one exists.
|
||||||
pre: ~[Identifier],
|
priv pre: ~[Identifier],
|
||||||
/// The build metadata, ignored when determining version precedence.
|
/// The build metadata, ignored when determining version precedence.
|
||||||
build: ~[Identifier],
|
priv build: ~[Identifier],
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ToStr for Version {
|
impl ToStr for Version {
|
||||||
|
|
|
@ -105,18 +105,23 @@ pub trait Stats {
|
||||||
#[deriving(Clone, Eq)]
|
#[deriving(Clone, Eq)]
|
||||||
#[allow(missing_doc)]
|
#[allow(missing_doc)]
|
||||||
pub struct Summary {
|
pub struct Summary {
|
||||||
sum: f64,
|
priv sum: f64,
|
||||||
|
// public
|
||||||
min: f64,
|
min: f64,
|
||||||
|
// public
|
||||||
max: f64,
|
max: f64,
|
||||||
mean: f64,
|
priv mean: f64,
|
||||||
|
// public
|
||||||
median: f64,
|
median: f64,
|
||||||
var: f64,
|
priv var: f64,
|
||||||
std_dev: f64,
|
priv std_dev: f64,
|
||||||
std_dev_pct: f64,
|
priv std_dev_pct: f64,
|
||||||
|
// public
|
||||||
median_abs_dev: f64,
|
median_abs_dev: f64,
|
||||||
|
// public
|
||||||
median_abs_dev_pct: f64,
|
median_abs_dev_pct: f64,
|
||||||
quartiles: (f64,f64,f64),
|
priv quartiles: (f64,f64,f64),
|
||||||
iqr: f64,
|
priv iqr: f64,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Summary {
|
impl Summary {
|
||||||
|
|
|
@ -376,8 +376,8 @@ impl Semaphore {
|
||||||
* A task which fails while holding a mutex will unlock the mutex as it
|
* A task which fails while holding a mutex will unlock the mutex as it
|
||||||
* unwinds.
|
* unwinds.
|
||||||
*/
|
*/
|
||||||
pub struct Mutex { priv sem: Sem<~[WaitQueue]> }
|
|
||||||
|
|
||||||
|
pub struct Mutex { priv sem: Sem<~[WaitQueue]> }
|
||||||
impl Clone for Mutex {
|
impl Clone for Mutex {
|
||||||
/// Create a new handle to the mutex.
|
/// Create a new handle to the mutex.
|
||||||
fn clone(&self) -> Mutex { Mutex { sem: Sem((*self.sem).clone()) } }
|
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().
|
/// 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().
|
/// The "read permission" token used for rwlock.write_downgrade().
|
||||||
pub struct RWLockReadMode<'self> { priv lock: &'self RWLock,
|
pub struct RWLockReadMode<'self> { priv lock: &'self RWLock,
|
||||||
priv token: NonCopyable }
|
priv token: NonCopyable }
|
||||||
|
|
|
@ -28,8 +28,8 @@ enum Msg<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct TaskPool<T> {
|
pub struct TaskPool<T> {
|
||||||
channels: ~[Chan<Msg<T>>],
|
priv channels: ~[Chan<Msg<T>>],
|
||||||
next_index: uint,
|
priv next_index: uint,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[unsafe_destructor]
|
#[unsafe_destructor]
|
||||||
|
|
|
@ -95,14 +95,14 @@ fn cap_for_attr(attr: attr::Attr) -> &'static str {
|
||||||
|
|
||||||
#[cfg(not(target_os = "win32"))]
|
#[cfg(not(target_os = "win32"))]
|
||||||
pub struct Terminal {
|
pub struct Terminal {
|
||||||
num_colors: u16,
|
priv num_colors: u16,
|
||||||
priv out: @io::Writer,
|
priv out: @io::Writer,
|
||||||
priv ti: ~TermInfo
|
priv ti: ~TermInfo
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(target_os = "win32")]
|
#[cfg(target_os = "win32")]
|
||||||
pub struct Terminal {
|
pub struct Terminal {
|
||||||
num_colors: u16,
|
priv num_colors: u16,
|
||||||
priv out: @io::Writer,
|
priv out: @io::Writer,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -48,9 +48,9 @@ pub enum Param {
|
||||||
/// Container for static and dynamic variable arrays
|
/// Container for static and dynamic variable arrays
|
||||||
pub struct Variables {
|
pub struct Variables {
|
||||||
/// Static variables A-Z
|
/// Static variables A-Z
|
||||||
sta: [Param, ..26],
|
priv sta: [Param, ..26],
|
||||||
/// Dynamic variables a-z
|
/// Dynamic variables a-z
|
||||||
dyn: [Param, ..26]
|
priv dyn: [Param, ..26]
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Variables {
|
impl Variables {
|
||||||
|
|
|
@ -15,9 +15,9 @@ use std::hashmap::HashMap;
|
||||||
/// A parsed terminfo entry.
|
/// A parsed terminfo entry.
|
||||||
pub struct TermInfo {
|
pub struct TermInfo {
|
||||||
/// Names for the terminal
|
/// Names for the terminal
|
||||||
names: ~[~str],
|
priv names: ~[~str],
|
||||||
/// Map of capability name to boolean value
|
/// Map of capability name to boolean value
|
||||||
bools: HashMap<~str, bool>,
|
priv bools: HashMap<~str, bool>,
|
||||||
/// Map of capability name to numeric value
|
/// Map of capability name to numeric value
|
||||||
numbers: HashMap<~str, u16>,
|
numbers: HashMap<~str, u16>,
|
||||||
/// Map of capability name to raw (unexpanded) string
|
/// Map of capability name to raw (unexpanded) string
|
||||||
|
|
|
@ -102,9 +102,9 @@ impl TestFn {
|
||||||
|
|
||||||
// Structure passed to BenchFns
|
// Structure passed to BenchFns
|
||||||
pub struct BenchHarness {
|
pub struct BenchHarness {
|
||||||
iterations: u64,
|
priv iterations: u64,
|
||||||
ns_start: u64,
|
priv ns_start: u64,
|
||||||
ns_end: u64,
|
priv ns_end: u64,
|
||||||
bytes: u64
|
bytes: u64
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -124,8 +124,8 @@ pub struct TestDescAndFn {
|
||||||
|
|
||||||
#[deriving(Clone, Encodable, Decodable, Eq)]
|
#[deriving(Clone, Encodable, Decodable, Eq)]
|
||||||
pub struct Metric {
|
pub struct Metric {
|
||||||
value: f64,
|
priv value: f64,
|
||||||
noise: f64
|
priv noise: f64
|
||||||
}
|
}
|
||||||
|
|
||||||
#[deriving(Eq)]
|
#[deriving(Eq)]
|
||||||
|
@ -322,8 +322,8 @@ pub fn opt_shard(maybestr: Option<~str>) -> Option<(uint,uint)> {
|
||||||
|
|
||||||
#[deriving(Clone, Eq)]
|
#[deriving(Clone, Eq)]
|
||||||
pub struct BenchSamples {
|
pub struct BenchSamples {
|
||||||
ns_iter_summ: stats::Summary,
|
priv ns_iter_summ: stats::Summary,
|
||||||
mb_s: uint
|
priv mb_s: uint
|
||||||
}
|
}
|
||||||
|
|
||||||
#[deriving(Clone, Eq)]
|
#[deriving(Clone, Eq)]
|
||||||
|
|
|
@ -31,9 +31,10 @@ pub mod rustrt {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A record specifying a time value in seconds and nanoseconds.
|
/// 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
|
* Timespec assumes that pre-epoch Timespecs have negative sec and positive
|
||||||
* nsec fields. Darwin's and Linux's struct timespec functions handle pre-
|
* 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)]
|
#[deriving(Clone, DeepClone, Eq, Encodable, Decodable)]
|
||||||
pub struct Tm {
|
pub struct Tm {
|
||||||
tm_sec: i32, // seconds after the minute ~[0-60]
|
priv tm_sec: i32, // seconds after the minute ~[0-60]
|
||||||
tm_min: i32, // minutes after the hour ~[0-59]
|
priv tm_min: i32, // minutes after the hour ~[0-59]
|
||||||
tm_hour: i32, // hours after midnight ~[0-23]
|
priv tm_hour: i32, // hours after midnight ~[0-23]
|
||||||
tm_mday: i32, // days of the month ~[1-31]
|
priv tm_mday: i32, // days of the month ~[1-31]
|
||||||
tm_mon: i32, // months since January ~[0-11]
|
priv tm_mon: i32, // months since January ~[0-11]
|
||||||
tm_year: i32, // years since 1900
|
priv tm_year: i32, // years since 1900
|
||||||
tm_wday: i32, // days since Sunday ~[0-6]
|
priv tm_wday: i32, // days since Sunday ~[0-6]
|
||||||
tm_yday: i32, // days since January 1 ~[0-365]
|
priv tm_yday: i32, // days since January 1 ~[0-365]
|
||||||
tm_isdst: i32, // Daylight Savings Time flag
|
priv tm_isdst: i32, // Daylight Savings Time flag
|
||||||
tm_gmtoff: i32, // offset from UTC in seconds
|
priv tm_gmtoff: i32, // offset from UTC in seconds
|
||||||
tm_zone: ~str, // timezone abbreviation
|
priv tm_zone: ~str, // timezone abbreviation
|
||||||
tm_nsec: i32, // nanoseconds
|
priv tm_nsec: i32, // nanoseconds
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn empty_tm() -> Tm {
|
pub fn empty_tm() -> Tm {
|
||||||
|
|
|
@ -128,8 +128,8 @@ impl WorkMap {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct Database {
|
pub struct Database {
|
||||||
db_filename: Path,
|
priv db_filename: Path,
|
||||||
db_cache: TreeMap<~str, ~str>,
|
priv db_cache: TreeMap<~str, ~str>,
|
||||||
db_dirty: bool
|
db_dirty: bool
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -209,7 +209,7 @@ impl Drop for Database {
|
||||||
|
|
||||||
pub struct Logger {
|
pub struct Logger {
|
||||||
// FIXME #4432: Fill in
|
// FIXME #4432: Fill in
|
||||||
a: ()
|
priv a: ()
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Logger {
|
impl Logger {
|
||||||
|
@ -228,26 +228,26 @@ pub type FreshnessMap = TreeMap<~str,extern fn(&str,&str)->bool>;
|
||||||
#[deriving(Clone)]
|
#[deriving(Clone)]
|
||||||
pub struct Context {
|
pub struct Context {
|
||||||
db: RWArc<Database>,
|
db: RWArc<Database>,
|
||||||
logger: RWArc<Logger>,
|
priv logger: RWArc<Logger>,
|
||||||
cfg: Arc<json::Object>,
|
priv cfg: Arc<json::Object>,
|
||||||
/// Map from kinds (source, exe, url, etc.) to a freshness function.
|
/// Map from kinds (source, exe, url, etc.) to a freshness function.
|
||||||
/// The freshness function takes a name (e.g. file path) and value
|
/// 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.
|
/// (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,
|
/// 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
|
/// hash it, and return the result of comparing the given hash and the
|
||||||
/// read hash for equality.
|
/// read hash for equality.
|
||||||
freshness: Arc<FreshnessMap>
|
priv freshness: Arc<FreshnessMap>
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct Prep<'self> {
|
pub struct Prep<'self> {
|
||||||
ctxt: &'self Context,
|
priv ctxt: &'self Context,
|
||||||
fn_name: &'self str,
|
priv fn_name: &'self str,
|
||||||
declared_inputs: WorkMap,
|
priv declared_inputs: WorkMap,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct Exec {
|
pub struct Exec {
|
||||||
discovered_inputs: WorkMap,
|
priv discovered_inputs: WorkMap,
|
||||||
discovered_outputs: WorkMap
|
priv discovered_outputs: WorkMap
|
||||||
}
|
}
|
||||||
|
|
||||||
enum Work<'self, T> {
|
enum Work<'self, T> {
|
||||||
|
|
|
@ -490,7 +490,6 @@ pub struct Formatter<'self> {
|
||||||
|
|
||||||
/// Output buffer.
|
/// Output buffer.
|
||||||
buf: &'self mut io::Writer,
|
buf: &'self mut io::Writer,
|
||||||
|
|
||||||
priv curarg: vec::VecIterator<'self, Argument<'self>>,
|
priv curarg: vec::VecIterator<'self, Argument<'self>>,
|
||||||
priv args: &'self [Argument<'self>],
|
priv args: &'self [Argument<'self>],
|
||||||
}
|
}
|
||||||
|
|
|
@ -1009,7 +1009,7 @@ impl<R:Reader,C> Reader for Wrapper<R, C> {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct FILERes {
|
pub struct FILERes {
|
||||||
f: *libc::FILE,
|
priv f: *libc::FILE,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl FILERes {
|
impl FILERes {
|
||||||
|
@ -1282,7 +1282,7 @@ impl Writer for fd_t {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct FdRes {
|
pub struct FdRes {
|
||||||
fd: fd_t,
|
priv fd: fd_t,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl FdRes {
|
impl FdRes {
|
||||||
|
@ -1792,7 +1792,7 @@ pub mod fsync {
|
||||||
|
|
||||||
// Artifacts that need to fsync on destruction
|
// Artifacts that need to fsync on destruction
|
||||||
pub struct Res<t> {
|
pub struct Res<t> {
|
||||||
arg: Arg<t>,
|
priv arg: Arg<t>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl <t> Res<t> {
|
impl <t> Res<t> {
|
||||||
|
@ -1815,9 +1815,9 @@ pub mod fsync {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct Arg<t> {
|
pub struct Arg<t> {
|
||||||
val: t,
|
priv val: t,
|
||||||
opt_level: Option<Level>,
|
priv opt_level: Option<Level>,
|
||||||
fsync_fn: extern "Rust" fn(f: &t, Level) -> int,
|
priv fsync_fn: extern "Rust" fn(f: &t, Level) -> int,
|
||||||
}
|
}
|
||||||
|
|
||||||
// fsync file after executing blk
|
// fsync file after executing blk
|
||||||
|
|
|
@ -1790,9 +1790,9 @@ impl<'self, A, St> Iterator<A> for Unfold<'self, A, St> {
|
||||||
#[deriving(Clone)]
|
#[deriving(Clone)]
|
||||||
pub struct Counter<A> {
|
pub struct Counter<A> {
|
||||||
/// The current state the counter is at (next value to be yielded)
|
/// 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
|
/// The amount that this iterator is stepping by
|
||||||
step: A
|
priv step: A
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Creates a new counter with the specified start/step
|
/// Creates a new counter with the specified start/step
|
||||||
|
|
|
@ -41,7 +41,7 @@ pub fn align(size: uint, align: uint) -> uint {
|
||||||
|
|
||||||
/// Adaptor to wrap around visitors implementing MovePtr.
|
/// Adaptor to wrap around visitors implementing MovePtr.
|
||||||
pub struct MovePtrAdaptor<V> {
|
pub struct MovePtrAdaptor<V> {
|
||||||
inner: V
|
priv inner: V
|
||||||
}
|
}
|
||||||
pub fn MovePtrAdaptor<V:TyVisitor + MovePtr>(v: V) -> MovePtrAdaptor<V> {
|
pub fn MovePtrAdaptor<V:TyVisitor + MovePtr>(v: V) -> MovePtrAdaptor<V> {
|
||||||
MovePtrAdaptor { inner: v }
|
MovePtrAdaptor { inner: v }
|
||||||
|
|
|
@ -98,10 +98,10 @@ enum VariantState {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct ReprVisitor<'self> {
|
pub struct ReprVisitor<'self> {
|
||||||
ptr: *c_void,
|
priv ptr: *c_void,
|
||||||
ptr_stk: ~[*c_void],
|
priv ptr_stk: ~[*c_void],
|
||||||
var_stk: ~[VariantState],
|
priv var_stk: ~[VariantState],
|
||||||
writer: &'self mut io::Writer
|
priv writer: &'self mut io::Writer
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn ReprVisitor<'a>(ptr: *c_void,
|
pub fn ReprVisitor<'a>(ptr: *c_void,
|
||||||
|
|
|
@ -29,9 +29,9 @@ static ALL_BITS: uint = FROZEN_BIT | MUT_BIT;
|
||||||
|
|
||||||
#[deriving(Eq)]
|
#[deriving(Eq)]
|
||||||
pub struct BorrowRecord {
|
pub struct BorrowRecord {
|
||||||
box: *mut raw::Box<()>,
|
priv box: *mut raw::Box<()>,
|
||||||
file: *c_char,
|
file: *c_char,
|
||||||
line: size_t
|
priv line: size_t
|
||||||
}
|
}
|
||||||
|
|
||||||
fn try_take_task_borrow_list() -> Option<~[BorrowRecord]> {
|
fn try_take_task_borrow_list() -> Option<~[BorrowRecord]> {
|
||||||
|
|
|
@ -48,14 +48,14 @@ struct Packet<T> {
|
||||||
|
|
||||||
// A one-shot channel.
|
// A one-shot channel.
|
||||||
pub struct ChanOne<T> {
|
pub struct ChanOne<T> {
|
||||||
void_packet: *mut Void,
|
priv void_packet: *mut Void,
|
||||||
suppress_finalize: bool
|
priv suppress_finalize: bool
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A one-shot port.
|
/// A one-shot port.
|
||||||
pub struct PortOne<T> {
|
pub struct PortOne<T> {
|
||||||
void_packet: *mut Void,
|
priv void_packet: *mut Void,
|
||||||
suppress_finalize: bool
|
priv suppress_finalize: bool
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn oneshot<T: Send>() -> (PortOne<T>, ChanOne<T>) {
|
pub fn oneshot<T: Send>() -> (PortOne<T>, ChanOne<T>) {
|
||||||
|
|
|
@ -25,11 +25,11 @@ pub static RED_ZONE: uint = 20 * 1024;
|
||||||
// then misalign the regs again.
|
// then misalign the regs again.
|
||||||
pub struct Context {
|
pub struct Context {
|
||||||
/// The context entry point, saved here for later destruction
|
/// 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
|
/// Hold the registers while the task or scheduler is suspended
|
||||||
regs: ~Registers,
|
priv regs: ~Registers,
|
||||||
/// Lower bound and upper bound for the stack
|
/// Lower bound and upper bound for the stack
|
||||||
stack_bounds: Option<(uint, uint)>,
|
priv stack_bounds: Option<(uint, uint)>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Context {
|
impl Context {
|
||||||
|
|
|
@ -26,9 +26,9 @@ pub struct ModEntry<'self> {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct CrateMap<'self> {
|
pub struct CrateMap<'self> {
|
||||||
version: i32,
|
priv version: i32,
|
||||||
entries: &'self [ModEntry<'self>],
|
priv entries: &'self [ModEntry<'self>],
|
||||||
children: &'self [&'self CrateMap<'self>]
|
priv children: &'self [&'self CrateMap<'self>]
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(windows))]
|
#[cfg(not(windows))]
|
||||||
|
|
|
@ -362,8 +362,8 @@ impl Seek for FileWriter {
|
||||||
/// For this reason, it is best to use the access-constrained wrappers that are
|
/// For this reason, it is best to use the access-constrained wrappers that are
|
||||||
/// exposed via `FileInfo.open_reader()` and `FileInfo.open_writer()`.
|
/// exposed via `FileInfo.open_reader()` and `FileInfo.open_writer()`.
|
||||||
pub struct FileStream {
|
pub struct FileStream {
|
||||||
fd: ~RtioFileStream,
|
priv fd: ~RtioFileStream,
|
||||||
last_nread: int,
|
priv last_nread: int,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// a `std::rt::io::Reader` trait impl for file I/O.
|
/// a `std::rt::io::Reader` trait impl for file I/O.
|
||||||
|
|
|
@ -17,7 +17,7 @@ use super::*;
|
||||||
|
|
||||||
/// A Writer decorator that compresses using the 'deflate' scheme
|
/// A Writer decorator that compresses using the 'deflate' scheme
|
||||||
pub struct DeflateWriter<W> {
|
pub struct DeflateWriter<W> {
|
||||||
inner_writer: W
|
priv inner_writer: W
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<W: Writer> DeflateWriter<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
|
/// A Reader decorator that decompresses using the 'deflate' scheme
|
||||||
pub struct InflateReader<R> {
|
pub struct InflateReader<R> {
|
||||||
inner_reader: R
|
priv inner_reader: R
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<R: Reader> InflateReader<R> {
|
impl<R: Reader> InflateReader<R> {
|
||||||
|
|
|
@ -13,7 +13,7 @@ use rt::io::{Reader, Writer};
|
||||||
|
|
||||||
pub struct MockReader {
|
pub struct MockReader {
|
||||||
read: ~fn(buf: &mut [u8]) -> Option<uint>,
|
read: ~fn(buf: &mut [u8]) -> Option<uint>,
|
||||||
eof: ~fn() -> bool
|
priv eof: ~fn() -> bool
|
||||||
}
|
}
|
||||||
|
|
||||||
impl MockReader {
|
impl MockReader {
|
||||||
|
@ -31,8 +31,8 @@ impl Reader for MockReader {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct MockWriter {
|
pub struct MockWriter {
|
||||||
write: ~fn(buf: &[u8]),
|
priv write: ~fn(buf: &[u8]),
|
||||||
flush: ~fn()
|
priv flush: ~fn()
|
||||||
}
|
}
|
||||||
|
|
||||||
impl MockWriter {
|
impl MockWriter {
|
||||||
|
|
|
@ -219,17 +219,17 @@ pub struct Death {
|
||||||
// might kill it. This is optional so we can take it by-value at exit time.
|
// might kill it. This is optional so we can take it by-value at exit time.
|
||||||
kill_handle: Option<KillHandle>,
|
kill_handle: Option<KillHandle>,
|
||||||
// Handle to a watching parent, if we have one, for exit code propagation.
|
// 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
|
// 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.
|
// until all its watched children exit before collecting the status.
|
||||||
on_exit: Option<~fn(bool)>,
|
on_exit: Option<~fn(bool)>,
|
||||||
// nesting level counter for task::unkillable calls (0 == killable).
|
// nesting level counter for task::unkillable calls (0 == killable).
|
||||||
unkillable: int,
|
priv unkillable: int,
|
||||||
// nesting level counter for unstable::atomically calls (0 == can deschedule).
|
// 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
|
// 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.
|
// 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 {
|
impl Drop for KillFlag {
|
||||||
|
|
|
@ -32,8 +32,8 @@ pub type OpaqueBox = c_void;
|
||||||
pub type TypeDesc = c_void;
|
pub type TypeDesc = c_void;
|
||||||
|
|
||||||
pub struct LocalHeap {
|
pub struct LocalHeap {
|
||||||
memory_region: *MemoryRegion,
|
priv memory_region: *MemoryRegion,
|
||||||
boxed_region: *BoxedRegion
|
priv boxed_region: *BoxedRegion
|
||||||
}
|
}
|
||||||
|
|
||||||
impl LocalHeap {
|
impl LocalHeap {
|
||||||
|
|
|
@ -24,7 +24,7 @@ use libc::c_void;
|
||||||
use cast;
|
use cast;
|
||||||
|
|
||||||
pub struct RC<T> {
|
pub struct RC<T> {
|
||||||
p: *c_void // ~(uint, T)
|
priv p: *c_void // ~(uint, T)
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T> RC<T> {
|
impl<T> RC<T> {
|
||||||
|
|
|
@ -66,7 +66,7 @@ pub struct FileOpenConfig {
|
||||||
/// Flags for file access mode (as per open(2))
|
/// Flags for file access mode (as per open(2))
|
||||||
flags: int,
|
flags: int,
|
||||||
/// File creation mode, ignored unless O_CREAT is passed as part of flags
|
/// File creation mode, ignored unless O_CREAT is passed as part of flags
|
||||||
mode: int
|
priv mode: int
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait IoFactory {
|
pub trait IoFactory {
|
||||||
|
|
|
@ -66,26 +66,26 @@ pub struct Scheduler {
|
||||||
event_loop: ~EventLoopObject,
|
event_loop: ~EventLoopObject,
|
||||||
/// The scheduler runs on a special task. When it is not running
|
/// The scheduler runs on a special task. When it is not running
|
||||||
/// it is stored here instead of the work queue.
|
/// 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
|
/// An action performed after a context switch on behalf of the
|
||||||
/// code running before the context switch
|
/// 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?
|
/// Should this scheduler run any task, or only pinned tasks?
|
||||||
run_anything: bool,
|
run_anything: bool,
|
||||||
/// If the scheduler shouldn't run some tasks, a friend to send
|
/// If the scheduler shouldn't run some tasks, a friend to send
|
||||||
/// them to.
|
/// them to.
|
||||||
friend_handle: Option<SchedHandle>,
|
priv friend_handle: Option<SchedHandle>,
|
||||||
/// A fast XorShift rng for scheduler use
|
/// A fast XorShift rng for scheduler use
|
||||||
rng: XorShiftRng,
|
rng: XorShiftRng,
|
||||||
/// A toggleable idle callback
|
/// A toggleable idle callback
|
||||||
idle_callback: Option<~PausibleIdleCallback>,
|
priv idle_callback: Option<~PausibleIdleCallback>,
|
||||||
/// A countdown that starts at a random value and is decremented
|
/// A countdown that starts at a random value and is decremented
|
||||||
/// every time a yield check is performed. When it hits 0 a task
|
/// every time a yield check is performed. When it hits 0 a task
|
||||||
/// will yield.
|
/// will yield.
|
||||||
yield_check_count: uint,
|
priv yield_check_count: uint,
|
||||||
/// A flag to tell the scheduler loop it needs to do some stealing
|
/// A flag to tell the scheduler loop it needs to do some stealing
|
||||||
/// in order to introduce randomness as part of a yield
|
/// 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
|
/// An indication of how hard to work on a given operation, the difference
|
||||||
|
|
|
@ -15,8 +15,8 @@ use ops::Drop;
|
||||||
use libc::{c_uint, uintptr_t};
|
use libc::{c_uint, uintptr_t};
|
||||||
|
|
||||||
pub struct StackSegment {
|
pub struct StackSegment {
|
||||||
buf: ~[u8],
|
priv buf: ~[u8],
|
||||||
valgrind_id: c_uint
|
priv valgrind_id: c_uint
|
||||||
}
|
}
|
||||||
|
|
||||||
impl StackSegment {
|
impl StackSegment {
|
||||||
|
|
|
@ -44,7 +44,7 @@ use send_str::SendStr;
|
||||||
|
|
||||||
pub struct Task {
|
pub struct Task {
|
||||||
heap: LocalHeap,
|
heap: LocalHeap,
|
||||||
gc: GarbageCollector,
|
priv gc: GarbageCollector,
|
||||||
storage: LocalStorage,
|
storage: LocalStorage,
|
||||||
logger: StdErrLogger,
|
logger: StdErrLogger,
|
||||||
unwinder: Unwinder,
|
unwinder: Unwinder,
|
||||||
|
@ -69,7 +69,7 @@ pub struct Coroutine {
|
||||||
/// The segment of stack on which the task is currently running or
|
/// The segment of stack on which the task is currently running or
|
||||||
/// if the task is blocked, on which the task will resume
|
/// if the task is blocked, on which the task will resume
|
||||||
/// execution.
|
/// execution.
|
||||||
current_stack_segment: StackSegment,
|
priv current_stack_segment: StackSegment,
|
||||||
/// Always valid if the task is alive and not running.
|
/// Always valid if the task is alive and not running.
|
||||||
saved_context: Context
|
saved_context: Context
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,9 +18,9 @@ use uint;
|
||||||
type raw_thread = libc::c_void;
|
type raw_thread = libc::c_void;
|
||||||
|
|
||||||
pub struct Thread {
|
pub struct Thread {
|
||||||
main: ~fn(),
|
priv main: ~fn(),
|
||||||
raw_thread: *raw_thread,
|
priv raw_thread: *raw_thread,
|
||||||
joined: bool,
|
priv joined: bool
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Thread {
|
impl Thread {
|
||||||
|
|
|
@ -28,7 +28,7 @@ struct TubeState<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct Tube<T> {
|
pub struct Tube<T> {
|
||||||
p: RC<TubeState<T>>
|
priv p: RC<TubeState<T>>
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T> Tube<T> {
|
impl<T> Tube<T> {
|
||||||
|
|
|
@ -25,7 +25,7 @@ type GetAddrInfoCallback = ~fn(GetAddrInfoRequest, &UvAddrInfo, Option<UvError>)
|
||||||
pub struct GetAddrInfoRequest(*uvll::uv_getaddrinfo_t);
|
pub struct GetAddrInfoRequest(*uvll::uv_getaddrinfo_t);
|
||||||
|
|
||||||
pub struct RequestData {
|
pub struct RequestData {
|
||||||
getaddrinfo_cb: Option<GetAddrInfoCallback>,
|
priv getaddrinfo_cb: Option<GetAddrInfoCallback>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl GetAddrInfoRequest {
|
impl GetAddrInfoRequest {
|
||||||
|
|
|
@ -25,7 +25,7 @@ pub struct FsRequest(*uvll::uv_fs_t);
|
||||||
impl Request for FsRequest {}
|
impl Request for FsRequest {}
|
||||||
|
|
||||||
pub struct RequestData {
|
pub struct RequestData {
|
||||||
complete_cb: Option<FsCallback>
|
priv complete_cb: Option<FsCallback>
|
||||||
}
|
}
|
||||||
|
|
||||||
impl FsRequest {
|
impl FsRequest {
|
||||||
|
|
|
@ -80,7 +80,7 @@ pub mod pipe;
|
||||||
/// with dtors may not be destructured, but tuple structs can,
|
/// with dtors may not be destructured, but tuple structs can,
|
||||||
/// but the results are not correct.
|
/// but the results are not correct.
|
||||||
pub struct Loop {
|
pub struct Loop {
|
||||||
handle: *uvll::uv_loop_t
|
priv handle: *uvll::uv_loop_t
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The trait implemented by uv 'watchers' (handles). Watchers are
|
/// The trait implemented by uv 'watchers' (handles). Watchers are
|
||||||
|
|
|
@ -180,7 +180,7 @@ fn socket_name<T, U: Watcher + NativeHandle<*T>>(sk: SocketNameKind,
|
||||||
|
|
||||||
// Obviously an Event Loop is always home.
|
// Obviously an Event Loop is always home.
|
||||||
pub struct UvEventLoop {
|
pub struct UvEventLoop {
|
||||||
uvio: UvIoFactory
|
priv uvio: UvIoFactory
|
||||||
}
|
}
|
||||||
|
|
||||||
impl UvEventLoop {
|
impl UvEventLoop {
|
||||||
|
@ -240,9 +240,9 @@ impl EventLoop for UvEventLoop {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct UvPausibleIdleCallback {
|
pub struct UvPausibleIdleCallback {
|
||||||
watcher: IdleWatcher,
|
priv watcher: IdleWatcher,
|
||||||
idle_flag: bool,
|
priv idle_flag: bool,
|
||||||
closed: bool
|
priv closed: bool
|
||||||
}
|
}
|
||||||
|
|
||||||
impl UvPausibleIdleCallback {
|
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.
|
// The entire point of async is to call into a loop from other threads so it does not need to home.
|
||||||
pub struct UvRemoteCallback {
|
pub struct UvRemoteCallback {
|
||||||
// The uv async handle for triggering the callback
|
// 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
|
// A flag to tell the callback to exit, set from the dtor. This is
|
||||||
// almost never contested - only in rare races with the dtor.
|
// almost never contested - only in rare races with the dtor.
|
||||||
exit_flag: Exclusive<bool>
|
priv exit_flag: Exclusive<bool>
|
||||||
}
|
}
|
||||||
|
|
||||||
impl UvRemoteCallback {
|
impl UvRemoteCallback {
|
||||||
|
@ -801,8 +801,8 @@ impl IoFactory for UvIoFactory {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct UvTcpListener {
|
pub struct UvTcpListener {
|
||||||
watcher : TcpWatcher,
|
priv watcher : TcpWatcher,
|
||||||
home: SchedHandle,
|
priv home: SchedHandle,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl HomingIO for UvTcpListener {
|
impl HomingIO for UvTcpListener {
|
||||||
|
@ -863,8 +863,8 @@ impl RtioTcpListener for UvTcpListener {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct UvTcpAcceptor {
|
pub struct UvTcpAcceptor {
|
||||||
listener: UvTcpListener,
|
priv listener: UvTcpListener,
|
||||||
incoming: Tube<Result<~RtioTcpStreamObject, IoError>>,
|
priv incoming: Tube<Result<~RtioTcpStreamObject, IoError>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl HomingIO for UvTcpAcceptor {
|
impl HomingIO for UvTcpAcceptor {
|
||||||
|
@ -988,7 +988,7 @@ fn write_stream(mut watcher: StreamWatcher,
|
||||||
|
|
||||||
pub struct UvUnboundPipe {
|
pub struct UvUnboundPipe {
|
||||||
pipe: Pipe,
|
pipe: Pipe,
|
||||||
home: SchedHandle,
|
priv home: SchedHandle,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl HomingIO for UvUnboundPipe {
|
impl HomingIO for UvUnboundPipe {
|
||||||
|
@ -1040,8 +1040,8 @@ impl RtioPipe for UvPipeStream {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct UvTcpStream {
|
pub struct UvTcpStream {
|
||||||
watcher: TcpWatcher,
|
priv watcher: TcpWatcher,
|
||||||
home: SchedHandle,
|
priv home: SchedHandle,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl HomingIO for UvTcpStream {
|
impl HomingIO for UvTcpStream {
|
||||||
|
@ -1140,8 +1140,8 @@ impl RtioTcpStream for UvTcpStream {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct UvUdpSocket {
|
pub struct UvUdpSocket {
|
||||||
watcher: UdpWatcher,
|
priv watcher: UdpWatcher,
|
||||||
home: SchedHandle,
|
priv home: SchedHandle,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl HomingIO for UvUdpSocket {
|
impl HomingIO for UvUdpSocket {
|
||||||
|
@ -1350,8 +1350,8 @@ impl RtioUdpSocket for UvUdpSocket {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct UvTimer {
|
pub struct UvTimer {
|
||||||
watcher: timer::TimerWatcher,
|
priv watcher: timer::TimerWatcher,
|
||||||
home: SchedHandle,
|
priv home: SchedHandle,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl HomingIO for UvTimer {
|
impl HomingIO for UvTimer {
|
||||||
|
@ -1397,10 +1397,10 @@ impl RtioTimer for UvTimer {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct UvFileStream {
|
pub struct UvFileStream {
|
||||||
loop_: Loop,
|
priv loop_: Loop,
|
||||||
fd: c_int,
|
priv fd: c_int,
|
||||||
close_on_drop: bool,
|
priv close_on_drop: bool,
|
||||||
home: SchedHandle
|
priv home: SchedHandle
|
||||||
}
|
}
|
||||||
|
|
||||||
impl HomingIO for UvFileStream {
|
impl HomingIO for UvFileStream {
|
||||||
|
@ -1530,11 +1530,11 @@ impl RtioFileStream for UvFileStream {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct UvProcess {
|
pub struct UvProcess {
|
||||||
process: process::Process,
|
priv process: process::Process,
|
||||||
|
|
||||||
// Sadly, this structure must be created before we return it, so in that
|
// Sadly, this structure must be created before we return it, so in that
|
||||||
// brief interim the `home` is None.
|
// brief interim the `home` is None.
|
||||||
home: Option<SchedHandle>,
|
priv home: Option<SchedHandle>,
|
||||||
|
|
||||||
// All None until the process exits (exit_error may stay None)
|
// All None until the process exits (exit_error may stay None)
|
||||||
priv exit_status: Option<int>,
|
priv exit_status: Option<int>,
|
||||||
|
|
|
@ -134,26 +134,26 @@ pub type uv_pipe_t = c_void;
|
||||||
|
|
||||||
pub struct uv_timespec_t {
|
pub struct uv_timespec_t {
|
||||||
tv_sec: libc::c_long,
|
tv_sec: libc::c_long,
|
||||||
tv_nsec: libc::c_long
|
priv tv_nsec: libc::c_long
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct uv_stat_t {
|
pub struct uv_stat_t {
|
||||||
st_dev: libc::uint64_t,
|
priv st_dev: libc::uint64_t,
|
||||||
st_mode: libc::uint64_t,
|
st_mode: libc::uint64_t,
|
||||||
st_nlink: libc::uint64_t,
|
priv st_nlink: libc::uint64_t,
|
||||||
st_uid: libc::uint64_t,
|
priv st_uid: libc::uint64_t,
|
||||||
st_gid: libc::uint64_t,
|
priv st_gid: libc::uint64_t,
|
||||||
st_rdev: libc::uint64_t,
|
priv st_rdev: libc::uint64_t,
|
||||||
st_ino: libc::uint64_t,
|
priv st_ino: libc::uint64_t,
|
||||||
st_size: libc::uint64_t,
|
st_size: libc::uint64_t,
|
||||||
st_blksize: libc::uint64_t,
|
priv st_blksize: libc::uint64_t,
|
||||||
st_blocks: libc::uint64_t,
|
priv st_blocks: libc::uint64_t,
|
||||||
st_flags: libc::uint64_t,
|
priv st_flags: libc::uint64_t,
|
||||||
st_gen: libc::uint64_t,
|
priv st_gen: libc::uint64_t,
|
||||||
st_atim: uv_timespec_t,
|
st_atim: uv_timespec_t,
|
||||||
st_mtim: uv_timespec_t,
|
st_mtim: uv_timespec_t,
|
||||||
st_ctim: uv_timespec_t,
|
st_ctim: uv_timespec_t,
|
||||||
st_birthtim: uv_timespec_t
|
priv st_birthtim: uv_timespec_t
|
||||||
}
|
}
|
||||||
|
|
||||||
impl uv_stat_t {
|
impl uv_stat_t {
|
||||||
|
@ -231,37 +231,37 @@ pub type socklen_t = c_int;
|
||||||
#[cfg(target_os = "android")]
|
#[cfg(target_os = "android")]
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
pub struct addrinfo {
|
pub struct addrinfo {
|
||||||
ai_flags: c_int,
|
priv ai_flags: c_int,
|
||||||
ai_family: c_int,
|
priv ai_family: c_int,
|
||||||
ai_socktype: c_int,
|
priv ai_socktype: c_int,
|
||||||
ai_protocol: c_int,
|
priv ai_protocol: c_int,
|
||||||
ai_addrlen: socklen_t,
|
priv ai_addrlen: socklen_t,
|
||||||
ai_addr: *sockaddr,
|
ai_addr: *sockaddr,
|
||||||
ai_canonname: *char,
|
priv ai_canonname: *char,
|
||||||
ai_next: *addrinfo
|
ai_next: *addrinfo
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(target_os = "macos")]
|
||||||
#[cfg(target_os = "freebsd")]
|
#[cfg(target_os = "freebsd")]
|
||||||
pub struct addrinfo {
|
pub struct addrinfo {
|
||||||
ai_flags: c_int,
|
priv ai_flags: c_int,
|
||||||
ai_family: c_int,
|
priv ai_family: c_int,
|
||||||
ai_socktype: c_int,
|
priv ai_socktype: c_int,
|
||||||
ai_protocol: c_int,
|
priv ai_protocol: c_int,
|
||||||
ai_addrlen: socklen_t,
|
priv ai_addrlen: socklen_t,
|
||||||
ai_canonname: *char,
|
priv ai_canonname: *char,
|
||||||
ai_addr: *sockaddr,
|
ai_addr: *sockaddr,
|
||||||
ai_next: *addrinfo
|
ai_next: *addrinfo
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
pub struct addrinfo {
|
pub struct addrinfo {
|
||||||
ai_flags: c_int,
|
priv ai_flags: c_int,
|
||||||
ai_family: c_int,
|
priv ai_family: c_int,
|
||||||
ai_socktype: c_int,
|
priv ai_socktype: c_int,
|
||||||
ai_protocol: c_int,
|
priv ai_protocol: c_int,
|
||||||
ai_addrlen: size_t,
|
priv ai_addrlen: size_t,
|
||||||
ai_canonname: *char,
|
priv ai_canonname: *char,
|
||||||
ai_addr: *sockaddr,
|
ai_addr: *sockaddr,
|
||||||
ai_next: *addrinfo
|
ai_next: *addrinfo
|
||||||
}
|
}
|
||||||
|
@ -960,8 +960,8 @@ pub unsafe fn freeaddrinfo(ai: *addrinfo) {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct uv_err_data {
|
pub struct uv_err_data {
|
||||||
err_name: ~str,
|
priv err_name: ~str,
|
||||||
err_msg: ~str,
|
priv err_msg: ~str,
|
||||||
}
|
}
|
||||||
|
|
||||||
extern {
|
extern {
|
||||||
|
|
|
@ -34,7 +34,6 @@ pub struct Process {
|
||||||
|
|
||||||
/// Options that can be given when starting a Process.
|
/// Options that can be given when starting a Process.
|
||||||
pub struct ProcessOptions<'self> {
|
pub struct ProcessOptions<'self> {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* If this is None then the new process will have the same initial
|
* If this is None then the new process will have the same initial
|
||||||
* environment as the parent process.
|
* environment as the parent process.
|
||||||
|
@ -99,7 +98,6 @@ impl <'self> ProcessOptions<'self> {
|
||||||
|
|
||||||
/// The output of a finished process.
|
/// The output of a finished process.
|
||||||
pub struct ProcessOutput {
|
pub struct ProcessOutput {
|
||||||
|
|
||||||
/// The status (exit code) of the process.
|
/// The status (exit code) of the process.
|
||||||
status: int,
|
status: int,
|
||||||
|
|
||||||
|
|
|
@ -998,7 +998,6 @@ pub fn utf8_char_width(b: u8) -> uint {
|
||||||
pub struct CharRange {
|
pub struct CharRange {
|
||||||
/// Current `char`
|
/// Current `char`
|
||||||
ch: char,
|
ch: char,
|
||||||
|
|
||||||
/// Index of the first byte of the next `char`
|
/// Index of the first byte of the next `char`
|
||||||
next: uint
|
next: uint
|
||||||
}
|
}
|
||||||
|
|
|
@ -108,7 +108,7 @@ pub enum SchedMode {
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
pub struct SchedOpts {
|
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.
|
* scheduler other tasks will be impeded or even blocked indefinitely.
|
||||||
*/
|
*/
|
||||||
pub struct TaskOpts {
|
pub struct TaskOpts {
|
||||||
linked: bool,
|
priv linked: bool,
|
||||||
supervised: bool,
|
priv supervised: bool,
|
||||||
watched: bool,
|
priv watched: bool,
|
||||||
indestructible: bool,
|
priv indestructible: bool,
|
||||||
notify_chan: Option<Chan<TaskResult>>,
|
priv notify_chan: Option<Chan<TaskResult>>,
|
||||||
name: Option<SendStr>,
|
name: Option<SendStr>,
|
||||||
sched: SchedOpts,
|
sched: SchedOpts,
|
||||||
stack_size: Option<uint>
|
stack_size: Option<uint>
|
||||||
|
@ -170,9 +170,9 @@ pub struct TaskOpts {
|
||||||
// FIXME (#3724): Replace the 'consumed' bit with move mode on self
|
// FIXME (#3724): Replace the 'consumed' bit with move mode on self
|
||||||
pub struct TaskBuilder {
|
pub struct TaskBuilder {
|
||||||
opts: TaskOpts,
|
opts: TaskOpts,
|
||||||
gen_body: Option<~fn(v: ~fn()) -> ~fn()>,
|
priv gen_body: Option<~fn(v: ~fn()) -> ~fn()>,
|
||||||
can_not_copy: Option<util::NonCopyable>,
|
priv can_not_copy: Option<util::NonCopyable>,
|
||||||
consumed: bool,
|
priv consumed: bool,
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -308,10 +308,10 @@ fn each_ancestor(list: &mut AncestorList,
|
||||||
// One of these per task.
|
// One of these per task.
|
||||||
pub struct Taskgroup {
|
pub struct Taskgroup {
|
||||||
// List of tasks with whose fates this one's is intertwined.
|
// 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.
|
// Lists of tasks who will kill us if they fail, but whom we won't kill.
|
||||||
ancestors: AncestorList,
|
priv ancestors: AncestorList,
|
||||||
notifier: Option<AutoNotify>,
|
priv notifier: Option<AutoNotify>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Drop for Taskgroup {
|
impl Drop for Taskgroup {
|
||||||
|
|
|
@ -49,23 +49,23 @@ pub struct TyDesc {
|
||||||
align: uint,
|
align: uint,
|
||||||
|
|
||||||
// Called on a copy of a value of type `T` *after* memcpy
|
// 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
|
// Called when a value of type `T` is no longer needed
|
||||||
drop_glue: GlueFn,
|
drop_glue: GlueFn,
|
||||||
|
|
||||||
// Called by drop glue when a value of type `T` can be freed
|
// 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`
|
// 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
|
// If T represents a box pointer (`@U` or `~U`), then
|
||||||
// `borrow_offset` is the amount that the pointer must be adjusted
|
// `borrow_offset` is the amount that the pointer must be adjusted
|
||||||
// to find the payload. This is always derivable from the type
|
// to find the payload. This is always derivable from the type
|
||||||
// `U`, but in the case of `@Trait` or `~Trait` objects, the type
|
// `U`, but in the case of `@Trait` or `~Trait` objects, the type
|
||||||
// `U` is unknown.
|
// `U` is unknown.
|
||||||
borrow_offset: uint,
|
priv borrow_offset: uint,
|
||||||
|
|
||||||
// Name corresponding to the type
|
// Name corresponding to the type
|
||||||
name: &'static str
|
name: &'static str
|
||||||
|
|
|
@ -15,7 +15,7 @@ use unstable::intrinsics::TyDesc;
|
||||||
pub struct Box<T> {
|
pub struct Box<T> {
|
||||||
ref_count: uint,
|
ref_count: uint,
|
||||||
type_desc: *TyDesc,
|
type_desc: *TyDesc,
|
||||||
prev: *Box<T>,
|
priv prev: *Box<T>,
|
||||||
next: *Box<T>,
|
next: *Box<T>,
|
||||||
data: T
|
data: T
|
||||||
}
|
}
|
||||||
|
|
|
@ -304,7 +304,7 @@ pub unsafe fn atomically<U>(f: &fn() -> U) -> U {
|
||||||
type rust_little_lock = *libc::c_void;
|
type rust_little_lock = *libc::c_void;
|
||||||
|
|
||||||
pub struct LittleLock {
|
pub struct LittleLock {
|
||||||
l: rust_little_lock,
|
priv l: rust_little_lock,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Drop for LittleLock {
|
impl Drop for LittleLock {
|
||||||
|
@ -353,7 +353,7 @@ struct ExData<T> {
|
||||||
* need to block or deschedule while accessing shared state, use extra::sync::RWArc.
|
* need to block or deschedule while accessing shared state, use extra::sync::RWArc.
|
||||||
*/
|
*/
|
||||||
pub struct Exclusive<T> {
|
pub struct Exclusive<T> {
|
||||||
x: UnsafeArc<ExData<T>>
|
priv x: UnsafeArc<ExData<T>>
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<T:Send> Clone for Exclusive<T> {
|
impl<T:Send> Clone for Exclusive<T> {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue