std: Switch field privacy as necessary

This commit is contained in:
Alex Crichton 2014-03-27 15:09:47 -07:00
parent f2a5c7a179
commit 9a3d04ae76
65 changed files with 882 additions and 886 deletions

View File

@ -25,7 +25,7 @@ use option::{Option, Some, None};
/// Datatype to hold one ascii character. It wraps a `u8`, with the highest bit always zero.
#[deriving(Clone, Eq, Ord, TotalOrd, TotalEq, Hash)]
pub struct Ascii { priv chr: u8 }
pub struct Ascii { chr: u8 }
impl Ascii {
/// Converts an ascii character into a `u8`.

View File

@ -86,8 +86,8 @@ use raw::Slice;
/// This structure wraps a `*libc::c_char`, and will automatically free the
/// memory it is pointing to when it goes out of scope.
pub struct CString {
priv buf: *libc::c_char,
priv owns_buffer_: bool,
buf: *libc::c_char,
owns_buffer_: bool,
}
impl Clone for CString {
@ -373,8 +373,8 @@ fn check_for_null(v: &[u8], buf: *mut libc::c_char) {
///
/// Use with the `std::iter` module.
pub struct CChars<'a> {
priv ptr: *libc::c_char,
priv marker: marker::ContravariantLifetime<'a>,
ptr: *libc::c_char,
marker: marker::ContravariantLifetime<'a>,
}
impl<'a> Iterator<libc::c_char> for CChars<'a> {

View File

@ -44,9 +44,9 @@ use raw;
/// The type representing a foreign chunk of memory
pub struct CVec<T> {
priv base: *mut T,
priv len: uint,
priv dtor: Option<proc:Send()>,
base: *mut T,
len: uint,
dtor: Option<proc:Send()>,
}
#[unsafe_destructor]

View File

@ -21,8 +21,8 @@ use ty::Unsafe;
/// A mutable memory location that admits only `Copy` data.
pub struct Cell<T> {
priv value: Unsafe<T>,
priv noshare: marker::NoShare,
value: Unsafe<T>,
noshare: marker::NoShare,
}
impl<T:Copy> Cell<T> {
@ -69,10 +69,10 @@ impl<T: fmt::Show> fmt::Show for Cell<T> {
/// A mutable memory location with dynamically checked borrow rules
pub struct RefCell<T> {
priv value: Unsafe<T>,
priv borrow: BorrowFlag,
priv nocopy: marker::NoCopy,
priv noshare: marker::NoShare,
value: Unsafe<T>,
borrow: BorrowFlag,
nocopy: marker::NoCopy,
noshare: marker::NoShare,
}
// Values [1, MAX-1] represent the number of `Ref` active
@ -202,7 +202,7 @@ impl<T: Eq> Eq for RefCell<T> {
/// Wraps a borrowed reference to a value in a `RefCell` box.
pub struct Ref<'b, T> {
priv parent: &'b RefCell<T>
parent: &'b RefCell<T>
}
#[unsafe_destructor]
@ -222,7 +222,7 @@ impl<'b, T> Deref<T> for Ref<'b, T> {
/// Wraps a mutable borrowed reference to a value in a `RefCell` box.
pub struct RefMut<'b, T> {
priv parent: &'b mut RefCell<T>
parent: &'b mut RefCell<T>
}
#[unsafe_destructor]

View File

@ -289,34 +289,34 @@ static RESCHED_FREQ: int = 256;
/// The receiving-half of Rust's channel type. This half can only be owned by
/// one task
pub struct Receiver<T> {
priv inner: Flavor<T>,
priv receives: Cell<uint>,
inner: Flavor<T>,
receives: Cell<uint>,
// can't share in an arc
priv marker: marker::NoShare,
marker: marker::NoShare,
}
/// An iterator over messages on a receiver, this iterator will block
/// whenever `next` is called, waiting for a new message, and `None` will be
/// returned when the corresponding channel has hung up.
pub struct Messages<'a, T> {
priv rx: &'a Receiver<T>
rx: &'a Receiver<T>
}
/// The sending-half of Rust's asynchronous channel type. This half can only be
/// owned by one task, but it can be cloned to send to other tasks.
pub struct Sender<T> {
priv inner: Flavor<T>,
priv sends: Cell<uint>,
inner: Flavor<T>,
sends: Cell<uint>,
// can't share in an arc
priv marker: marker::NoShare,
marker: marker::NoShare,
}
/// The sending-half of Rust's synchronous channel type. This half can only be
/// owned by one task, but it can be cloned to send to other tasks.
pub struct SyncSender<T> {
priv inner: UnsafeArc<sync::Packet<T>>,
inner: UnsafeArc<sync::Packet<T>>,
// can't share in an arc
priv marker: marker::NoShare,
marker: marker::NoShare,
}
/// This enumeration is the list of the possible reasons that try_recv could not

View File

@ -62,10 +62,10 @@ use uint;
/// The "receiver set" of the select interface. This structure is used to manage
/// a set of receivers which are being selected over.
pub struct Select {
priv head: *mut Handle<'static, ()>,
priv tail: *mut Handle<'static, ()>,
priv next_id: Cell<uint>,
priv marker1: marker::NoSend,
head: *mut Handle<'static, ()>,
tail: *mut Handle<'static, ()>,
next_id: Cell<uint>,
marker1: marker::NoSend,
}
/// A handle to a receiver which is currently a member of a `Select` set of
@ -74,16 +74,16 @@ pub struct Select {
pub struct Handle<'rx, T> {
/// The ID of this handle, used to compare against the return value of
/// `Select::wait()`
priv id: uint,
priv selector: &'rx Select,
priv next: *mut Handle<'static, ()>,
priv prev: *mut Handle<'static, ()>,
priv added: bool,
priv packet: &'rx Packet,
id: uint,
selector: &'rx Select,
next: *mut Handle<'static, ()>,
prev: *mut Handle<'static, ()>,
added: bool,
packet: &'rx Packet,
// due to our fun transmutes, we be sure to place this at the end. (nothing
// previous relies on T)
priv rx: &'rx Receiver<T>,
rx: &'rx Receiver<T>,
}
struct Packets { cur: *mut Handle<'static, ()> }

View File

@ -508,20 +508,20 @@ pub type Result = io::IoResult<()>;
/// traits.
pub struct Formatter<'a> {
/// Flags for formatting (packed version of rt::Flag)
flags: uint,
pub flags: uint,
/// Character used as 'fill' whenever there is alignment
fill: char,
pub fill: char,
/// Boolean indication of whether the output should be left-aligned
align: parse::Alignment,
pub align: parse::Alignment,
/// Optionally specified integer width that the output should be
width: Option<uint>,
pub width: Option<uint>,
/// Optionally specified precision for numeric types
precision: Option<uint>,
pub precision: Option<uint>,
/// Output buffer.
buf: &'a mut io::Writer,
priv curarg: slice::Items<'a, Argument<'a>>,
priv args: &'a [Argument<'a>],
pub buf: &'a mut io::Writer,
curarg: slice::Items<'a, Argument<'a>>,
args: &'a [Argument<'a>],
}
/// This struct represents the generic "argument" which is taken by the Xprintf
@ -529,8 +529,8 @@ pub struct Formatter<'a> {
/// compile time it is ensured that the function and the value have the correct
/// types, and then this struct is used to canonicalize arguments to one type.
pub struct Argument<'a> {
priv formatter: extern "Rust" fn(&any::Void, &mut Formatter) -> Result,
priv value: &'a any::Void,
formatter: extern "Rust" fn(&any::Void, &mut Formatter) -> Result,
value: &'a any::Void,
}
impl<'a> Arguments<'a> {
@ -555,8 +555,8 @@ impl<'a> Arguments<'a> {
/// string at compile-time so usage of the `write` and `format` functions can
/// be safely performed.
pub struct Arguments<'a> {
priv fmt: &'a [rt::Piece<'a>],
priv args: &'a [Argument<'a>],
fmt: &'a [rt::Piece<'a>],
args: &'a [Argument<'a>],
}
/// When a format is not otherwise specified, types are formatted by ascribing

View File

@ -108,7 +108,7 @@ radix!(UpperHex, 16, "0x", x @ 0 .. 9 => '0' as u8 + x,
/// A radix with in the range of `2..36`.
#[deriving(Clone, Eq)]
pub struct Radix {
priv base: u8,
base: u8,
}
impl Radix {

View File

@ -37,30 +37,30 @@ pub enum Piece<'a> {
#[deriving(Eq)]
pub struct Argument<'a> {
/// Where to find this argument
position: Position<'a>,
pub position: Position<'a>,
/// How to format the argument
format: FormatSpec<'a>,
pub format: FormatSpec<'a>,
/// If not `None`, what method to invoke on the argument
method: Option<~Method<'a>>
pub method: Option<~Method<'a>>
}
/// Specification for the formatting of an argument in the format string.
#[deriving(Eq)]
pub struct FormatSpec<'a> {
/// Optionally specified character to fill alignment with
fill: Option<char>,
pub fill: Option<char>,
/// Optionally specified alignment
align: Alignment,
pub align: Alignment,
/// Packed version of various flags provided
flags: uint,
pub flags: uint,
/// The integer precision to use
precision: Count<'a>,
pub precision: Count<'a>,
/// The string width requested for the resulting format
width: Count<'a>,
pub width: Count<'a>,
/// The descriptor string representing the name of the format desired for
/// this argument, this can be empty or any number of characters, although
/// it is required to be one word.
ty: &'a str
pub ty: &'a str
}
/// Enum describing where an argument for a format can be located.
@ -154,9 +154,9 @@ pub enum PluralSelector {
pub struct PluralArm<'a> {
/// A selector can either be specified by a keyword or with an integer
/// literal.
selector: PluralSelector,
pub selector: PluralSelector,
/// Array of pieces which are the format of this arm
result: ~[Piece<'a>],
pub result: ~[Piece<'a>],
}
/// Enum of the 5 CLDR plural keywords. There is one more, "other", but that
@ -182,9 +182,9 @@ pub enum PluralKeyword {
#[deriving(Eq)]
pub struct SelectArm<'a> {
/// String selector which guards this arm
selector: &'a str,
pub selector: &'a str,
/// Array of pieces which are the format of this arm
result: ~[Piece<'a>],
pub result: ~[Piece<'a>],
}
/// The parser structure for interpreting the input format string. This is
@ -194,11 +194,11 @@ pub struct SelectArm<'a> {
/// This is a recursive-descent parser for the sake of simplicity, and if
/// necessary there's probably lots of room for improvement performance-wise.
pub struct Parser<'a> {
priv input: &'a str,
priv cur: str::CharOffsets<'a>,
priv depth: uint,
input: &'a str,
cur: str::CharOffsets<'a>,
depth: uint,
/// Error messages accumulated during parsing
errors: ~[~str],
pub errors: ~[~str],
}
impl<'a> Iterator<Piece<'a>> for Parser<'a> {

View File

@ -28,17 +28,17 @@ pub enum Piece<'a> {
}
pub struct Argument<'a> {
position: Position,
format: FormatSpec,
method: Option<&'a Method<'a>>
pub position: Position,
pub format: FormatSpec,
pub method: Option<&'a Method<'a>>
}
pub struct FormatSpec {
fill: char,
align: parse::Alignment,
flags: uint,
precision: Count,
width: Count,
pub fill: char,
pub align: parse::Alignment,
pub flags: uint,
pub precision: Count,
pub width: Count,
}
pub enum Count {
@ -60,11 +60,11 @@ pub enum PluralSelector {
}
pub struct PluralArm<'a> {
selector: PluralSelector,
result: &'a [Piece<'a>],
pub selector: PluralSelector,
pub result: &'a [Piece<'a>],
}
pub struct SelectArm<'a> {
selector: &'a str,
result: &'a [Piece<'a>],
pub selector: &'a str,
pub result: &'a [Piece<'a>],
}

View File

@ -29,14 +29,14 @@ use managed;
task annihilation. For now, cycles need to be broken manually by using `Rc<T>` \
with a non-owning `Weak<T>` pointer. A tracing garbage collector is planned."]
pub struct Gc<T> {
priv ptr: @T,
priv marker: marker::NoSend,
ptr: @T,
marker: marker::NoSend,
}
#[cfg(test)]
pub struct Gc<T> {
priv ptr: @T,
priv marker: marker::NoSend,
ptr: @T,
marker: marker::NoSend,
}
impl<T: 'static> Gc<T> {

View File

@ -36,15 +36,15 @@ use super::{Hash, Hasher};
/// `SipState` computes a SipHash 2-4 hash over a stream of bytes.
pub struct SipState {
priv k0: u64,
priv k1: u64,
priv length: uint, // how many bytes we've processed
priv v0: u64, // hash state
priv v1: u64,
priv v2: u64,
priv v3: u64,
priv tail: [u8, ..8], // unprocessed bytes
priv ntail: uint, // how many bytes in tail are valid
k0: u64,
k1: u64,
length: uint, // how many bytes we've processed
v0: u64, // hash state
v1: u64,
v2: u64,
v3: u64,
tail: [u8, ..8], // unprocessed bytes
ntail: uint, // how many bytes in tail are valid
}
// sadly, these macro definitions can't appear later,
@ -231,8 +231,8 @@ impl Default for SipState {
/// `SipHasher` computes the SipHash algorithm from a stream of bytes.
#[deriving(Clone)]
pub struct SipHasher {
priv k0: u64,
priv k1: u64,
k0: u64,
k1: u64,
}
impl SipHasher {

View File

@ -53,19 +53,19 @@ pub type GlueFn = extern "Rust" fn(*i8);
#[cfg(not(test))]
pub struct TyDesc {
// sizeof(T)
size: uint,
pub size: uint,
// alignof(T)
align: uint,
pub align: uint,
// Called when a value of type `T` is no longer needed
drop_glue: GlueFn,
pub drop_glue: GlueFn,
// Called by reflection visitor to visit a value of type `T`
visit_glue: GlueFn,
pub visit_glue: GlueFn,
// Name corresponding to the type
name: &'static str
pub name: &'static str,
}
#[lang="opaque"]
@ -454,7 +454,7 @@ extern "rust-intrinsic" {
#[deriving(Eq, Hash, Show, TotalEq)]
#[cfg(not(test))]
pub struct TypeId {
priv t: u64,
t: u64,
}
#[cfg(not(test))]

View File

@ -43,10 +43,10 @@ use vec::Vec;
/// }
/// ```
pub struct BufferedReader<R> {
priv inner: R,
priv buf: Vec<u8>,
priv pos: uint,
priv cap: uint,
inner: R,
buf: Vec<u8>,
pos: uint,
cap: uint,
}
impl<R: Reader> BufferedReader<R> {
@ -135,9 +135,9 @@ impl<R: Reader> Reader for BufferedReader<R> {
/// writer.flush();
/// ```
pub struct BufferedWriter<W> {
priv inner: Option<W>,
priv buf: Vec<u8>,
priv pos: uint
inner: Option<W>,
buf: Vec<u8>,
pos: uint
}
impl<W: Writer> BufferedWriter<W> {
@ -220,7 +220,7 @@ impl<W: Writer> Drop for BufferedWriter<W> {
///
/// This writer will be flushed when it is dropped.
pub struct LineBufferedWriter<W> {
priv inner: BufferedWriter<W>,
inner: BufferedWriter<W>,
}
impl<W: Writer> LineBufferedWriter<W> {
@ -303,7 +303,7 @@ impl<W: Reader> Reader for InternalBufferedWriter<W> {
/// }
/// ```
pub struct BufferedStream<S> {
priv inner: BufferedReader<InternalBufferedWriter<S>>
inner: BufferedReader<InternalBufferedWriter<S>>
}
impl<S: Stream> BufferedStream<S> {
@ -391,7 +391,7 @@ mod test {
/// A dummy reader intended at testing short-reads propagation.
pub struct ShortReader {
priv lengths: ~[uint],
lengths: ~[uint],
}
impl Reader for ShortReader {

View File

@ -36,10 +36,10 @@ use slice::{bytes, CloneableVector, MutableVector, ImmutableVector};
/// }
/// ```
pub struct ChanReader {
priv buf: Option<~[u8]>, // A buffer of bytes received but not consumed.
priv pos: uint, // How many of the buffered bytes have already be consumed.
priv rx: Receiver<~[u8]>, // The rx to pull data from.
priv closed: bool, // Whether the pipe this rx connects to has been closed.
buf: Option<~[u8]>, // A buffer of bytes received but not consumed.
pos: uint, // How many of the buffered bytes have already be consumed.
rx: Receiver<~[u8]>, // The rx to pull data from.
closed: bool, // Whether the pipe this rx connects to has been closed.
}
impl ChanReader {
@ -98,7 +98,7 @@ impl Reader for ChanReader {
/// writer.write("hello, world".as_bytes());
/// ```
pub struct ChanWriter {
priv tx: Sender<~[u8]>,
tx: Sender<~[u8]>,
}
impl ChanWriter {

View File

@ -38,7 +38,7 @@ use ptr::RawPtr;
/// Any error other than `EndOfFile` that is produced by the underlying Reader
/// is returned by the iterator and should be handled by the caller.
pub struct Bytes<'r, T> {
priv reader: &'r mut T,
reader: &'r mut T,
}
impl<'r, R: Reader> Bytes<'r, R> {

View File

@ -78,9 +78,9 @@ use vec::Vec;
/// configured at creation time, via the `FileAccess` parameter to
/// `File::open_mode()`.
pub struct File {
priv fd: ~RtioFileStream:Send,
priv path: Path,
priv last_nread: int,
fd: ~RtioFileStream:Send,
path: Path,
last_nread: int,
}
impl File {
@ -498,7 +498,7 @@ pub fn walk_dir(path: &Path) -> IoResult<Directories> {
/// An iterator which walks over a directory
pub struct Directories {
priv stack: ~[Path],
stack: ~[Path],
}
impl Iterator<Path> for Directories {

View File

@ -52,8 +52,8 @@ fn combine(seek: SeekStyle, cur: uint, end: uint, offset: i64) -> IoResult<u64>
/// assert_eq!(w.unwrap(), ~[0, 1, 2]);
/// ```
pub struct MemWriter {
priv buf: ~[u8],
priv pos: uint,
buf: ~[u8],
pos: uint,
}
impl MemWriter {
@ -132,8 +132,8 @@ impl Seek for MemWriter {
/// assert_eq!(r.read_to_end().unwrap(), ~[0, 1, 2]);
/// ```
pub struct MemReader {
priv buf: ~[u8],
priv pos: uint
buf: ~[u8],
pos: uint
}
impl MemReader {
@ -219,8 +219,8 @@ impl Buffer for MemReader {
/// assert!(buf == [0, 1, 2, 0]);
/// ```
pub struct BufWriter<'a> {
priv buf: &'a mut [u8],
priv pos: uint
buf: &'a mut [u8],
pos: uint
}
impl<'a> BufWriter<'a> {
@ -275,8 +275,8 @@ impl<'a> Seek for BufWriter<'a> {
/// assert_eq!(r.read_to_end().unwrap(), ~[0, 1, 2, 3]);
/// ```
pub struct BufReader<'a> {
priv buf: &'a [u8],
priv pos: uint
buf: &'a [u8],
pos: uint
}
impl<'a> BufReader<'a> {

View File

@ -283,11 +283,11 @@ pub type IoResult<T> = Result<T, IoError>;
pub struct IoError {
/// An enumeration which can be matched against for determining the flavor
/// of error.
kind: IoErrorKind,
pub kind: IoErrorKind,
/// A human-readable description about the error
desc: &'static str,
pub desc: &'static str,
/// Detailed information about this error, not always available
detail: Option<~str>
pub detail: Option<~str>
}
impl fmt::Show for IoError {
@ -1023,7 +1023,7 @@ impl<T: Reader + Writer> Stream for T {}
/// Any error other than `EndOfFile` that is produced by the underlying Reader
/// is returned by the iterator and should be handled by the caller.
pub struct Lines<'r, T> {
priv buffer: &'r mut T,
buffer: &'r mut T,
}
impl<'r, T: Buffer> Iterator<IoResult<~str>> for Lines<'r, T> {
@ -1050,7 +1050,7 @@ impl<'r, T: Buffer> Iterator<IoResult<~str>> for Lines<'r, T> {
/// Any error other than `EndOfFile` that is produced by the underlying Reader
/// is returned by the iterator and should be handled by the caller.
pub struct Chars<'r, T> {
priv buffer: &'r mut T
buffer: &'r mut T
}
impl<'r, T: Buffer> Iterator<IoResult<char>> for Chars<'r, T> {
@ -1290,7 +1290,7 @@ pub trait Acceptor<T> {
/// connection attempt was successful. A successful connection will be wrapped
/// in `Ok`. A failed connection is represented as an `Err`.
pub struct IncomingConnections<'a, A> {
priv inc: &'a mut A,
inc: &'a mut A,
}
impl<'a, T, A: Acceptor<T>> Iterator<IoResult<T>> for IncomingConnections<'a, A> {
@ -1389,13 +1389,13 @@ pub enum FileType {
#[deriving(Hash)]
pub struct FileStat {
/// The path that this stat structure is describing
path: Path,
pub path: Path,
/// The size of the file, in bytes
size: u64,
pub size: u64,
/// The kind of file this path points to (directory, file, pipe, etc.)
kind: FileType,
pub kind: FileType,
/// The file permissions currently on the file
perm: FilePermission,
pub perm: FilePermission,
// FIXME(#10301): These time fields are pretty useless without an actual
// time representation, what are the milliseconds relative
@ -1403,13 +1403,13 @@ pub struct FileStat {
/// The time that the file was created at, in platform-dependent
/// milliseconds
created: u64,
pub created: u64,
/// The time that this file was last modified, in platform-dependent
/// milliseconds
modified: u64,
pub modified: u64,
/// The time that this file was last accessed, in platform-dependent
/// milliseconds
accessed: u64,
pub accessed: u64,
/// Information returned by stat() which is not guaranteed to be
/// platform-independent. This information may be useful on some platforms,
@ -1419,7 +1419,7 @@ pub struct FileStat {
/// Usage of this field is discouraged, but if access is desired then the
/// fields are located here.
#[unstable]
unstable: UnstableFileStat,
pub unstable: UnstableFileStat,
}
/// This structure represents all of the possible information which can be
@ -1430,25 +1430,25 @@ pub struct FileStat {
#[deriving(Hash)]
pub struct UnstableFileStat {
/// The ID of the device containing the file.
device: u64,
pub device: u64,
/// The file serial number.
inode: u64,
pub inode: u64,
/// The device ID.
rdev: u64,
pub rdev: u64,
/// The number of hard links to this file.
nlink: u64,
pub nlink: u64,
/// The user ID of the file.
uid: u64,
pub uid: u64,
/// The group ID of the file.
gid: u64,
pub gid: u64,
/// The optimal block size for I/O.
blksize: u64,
pub blksize: u64,
/// The blocks allocated for this file.
blocks: u64,
pub blocks: u64,
/// User-defined flags for the file.
flags: u64,
pub flags: u64,
/// The file generation number.
gen: u64,
pub gen: u64,
}
/// A set of permissions for a file or directory is represented by a set of

View File

@ -57,18 +57,18 @@ pub enum Protocol {
/// For details on these fields, see their corresponding definitions via
/// `man -s 3 getaddrinfo`
pub struct Hint {
family: uint,
socktype: Option<SocketType>,
protocol: Option<Protocol>,
flags: uint,
pub family: uint,
pub socktype: Option<SocketType>,
pub protocol: Option<Protocol>,
pub flags: uint,
}
pub struct Info {
address: SocketAddr,
family: uint,
socktype: Option<SocketType>,
protocol: Option<Protocol>,
flags: uint,
pub address: SocketAddr,
pub family: uint,
pub socktype: Option<SocketType>,
pub protocol: Option<Protocol>,
pub flags: uint,
}
/// Easy name resolution. Given a hostname, returns the list of IP addresses for

View File

@ -58,8 +58,8 @@ impl fmt::Show for IpAddr {
#[deriving(Eq, TotalEq, Clone, Hash)]
pub struct SocketAddr {
ip: IpAddr,
port: Port,
pub ip: IpAddr,
pub port: Port,
}
impl fmt::Show for SocketAddr {

View File

@ -17,8 +17,6 @@
//! A TCP connection implements the `Reader` and `Writer` traits, while the TCP
//! listener (socket server) implements the `Listener` and `Acceptor` traits.
#![deny(missing_doc)]
use clone::Clone;
use io::IoResult;
use io::net::ip::SocketAddr;
@ -46,7 +44,7 @@ use rt::rtio::{RtioTcpAcceptor, RtioTcpStream};
/// drop(stream); // close the connection
/// ```
pub struct TcpStream {
priv obj: ~RtioTcpStream:Send
obj: ~RtioTcpStream:Send
}
impl TcpStream {
@ -128,7 +126,7 @@ impl Writer for TcpStream {
/// # }
/// ```
pub struct TcpListener {
priv obj: ~RtioTcpListener:Send
obj: ~RtioTcpListener:Send
}
impl TcpListener {
@ -161,7 +159,7 @@ impl Listener<TcpStream, TcpAcceptor> for TcpListener {
/// a `TcpListener`'s `listen` method, and this object can be used to accept new
/// `TcpStream` instances.
pub struct TcpAcceptor {
priv obj: ~RtioTcpAcceptor:Send
obj: ~RtioTcpAcceptor:Send
}
impl Acceptor<TcpStream> for TcpAcceptor {

View File

@ -54,7 +54,7 @@ use rt::rtio::{RtioSocket, RtioUdpSocket, IoFactory, LocalIo};
/// drop(socket); // close the socket
/// ```
pub struct UdpSocket {
priv obj: ~RtioUdpSocket:Send
obj: ~RtioUdpSocket:Send
}
impl UdpSocket {
@ -115,8 +115,8 @@ impl Clone for UdpSocket {
/// A type that allows convenient usage of a UDP stream connected to one
/// address via the `Reader` and `Writer` traits.
pub struct UdpStream {
priv socket: UdpSocket,
priv connected_to: SocketAddr
socket: UdpSocket,
connected_to: SocketAddr
}
impl UdpStream {

View File

@ -36,7 +36,7 @@ use rt::rtio::{RtioUnixAcceptor, RtioPipe};
/// A stream which communicates over a named pipe.
pub struct UnixStream {
priv obj: PipeStream,
obj: PipeStream,
}
impl UnixStream {
@ -83,7 +83,7 @@ impl Writer for UnixStream {
/// A value that can listen for incoming named pipe connection requests.
pub struct UnixListener {
/// The internal, opaque runtime Unix listener.
priv obj: ~RtioUnixListener:Send,
obj: ~RtioUnixListener:Send,
}
impl UnixListener {
@ -125,7 +125,7 @@ impl Listener<UnixStream, UnixAcceptor> for UnixListener {
/// A value that can accept named pipe connections, returned from `listen()`.
pub struct UnixAcceptor {
/// The internal, opaque runtime Unix acceptor.
priv obj: ~RtioUnixAcceptor:Send,
obj: ~RtioUnixAcceptor:Send,
}
impl Acceptor<UnixStream> for UnixAcceptor {

View File

@ -23,7 +23,7 @@ use rt::rtio::{RtioPipe, LocalIo};
/// A synchronous, in-memory pipe.
pub struct PipeStream {
/// The internal, opaque runtime pipe object.
priv obj: ~RtioPipe:Send,
obj: ~RtioPipe:Send,
}
impl PipeStream {

View File

@ -10,8 +10,6 @@
//! Bindings for executing child processes
#![deny(missing_doc)]
use prelude::*;
use fmt;
@ -53,23 +51,23 @@ use rt::rtio::{RtioProcess, IoFactory, LocalIo};
/// assert!(child.wait().success());
/// ```
pub struct Process {
priv handle: ~RtioProcess:Send,
handle: ~RtioProcess:Send,
/// Handle to the child's stdin, if the `stdin` field of this process's
/// `ProcessConfig` was `CreatePipe`. By default, this handle is `Some`.
stdin: Option<io::PipeStream>,
pub stdin: Option<io::PipeStream>,
/// Handle to the child's stdout, if the `stdout` field of this process's
/// `ProcessConfig` was `CreatePipe`. By default, this handle is `Some`.
stdout: Option<io::PipeStream>,
pub stdout: Option<io::PipeStream>,
/// Handle to the child's stderr, if the `stderr` field of this process's
/// `ProcessConfig` was `CreatePipe`. By default, this handle is `Some`.
stderr: Option<io::PipeStream>,
pub stderr: Option<io::PipeStream>,
/// Extra I/O handles as configured by the original `ProcessConfig` when
/// this process was created. This is by default empty.
extra_io: ~[Option<io::PipeStream>],
pub extra_io: ~[Option<io::PipeStream>],
}
/// This configuration describes how a new process should be spawned. A blank
@ -88,33 +86,33 @@ pub struct Process {
/// ```
pub struct ProcessConfig<'a> {
/// Path to the program to run
program: &'a str,
pub program: &'a str,
/// Arguments to pass to the program (doesn't include the program itself)
args: &'a [~str],
pub args: &'a [~str],
/// Optional environment to specify for the program. If this is None, then
/// it will inherit the current process's environment.
env: Option<&'a [(~str, ~str)]>,
pub env: Option<&'a [(~str, ~str)]>,
/// Optional working directory for the new process. If this is None, then
/// the current directory of the running process is inherited.
cwd: Option<&'a Path>,
pub cwd: Option<&'a Path>,
/// Configuration for the child process's stdin handle (file descriptor 0).
/// This field defaults to `CreatePipe(true, false)` so the input can be
/// written to.
stdin: StdioContainer,
pub stdin: StdioContainer,
/// Configuration for the child process's stdout handle (file descriptor 1).
/// This field defaults to `CreatePipe(false, true)` so the output can be
/// collected.
stdout: StdioContainer,
pub stdout: StdioContainer,
/// Configuration for the child process's stdout handle (file descriptor 2).
/// This field defaults to `CreatePipe(false, true)` so the output can be
/// collected.
stderr: StdioContainer,
pub stderr: StdioContainer,
/// Any number of streams/file descriptors/pipes may be attached to this
/// process. This list enumerates the file descriptors and such for the
@ -122,31 +120,31 @@ pub struct ProcessConfig<'a> {
/// 3 and go to the length of this array. The first three file descriptors
/// (stdin/stdout/stderr) are configured with the `stdin`, `stdout`, and
/// `stderr` fields.
extra_io: &'a [StdioContainer],
pub extra_io: &'a [StdioContainer],
/// Sets the child process's user id. This translates to a `setuid` call in
/// the child process. Setting this value on windows will cause the spawn to
/// fail. Failure in the `setuid` call on unix will also cause the spawn to
/// fail.
uid: Option<uint>,
pub uid: Option<uint>,
/// Similar to `uid`, but sets the group id of the child process. This has
/// the same semantics as the `uid` field.
gid: Option<uint>,
pub gid: Option<uint>,
/// If true, the child process is spawned in a detached state. On unix, this
/// means that the child is the leader of a new process group.
detach: bool,
pub detach: bool,
}
/// The output of a finished process.
pub struct ProcessOutput {
/// The status (exit code) of the process.
status: ProcessExit,
pub status: ProcessExit,
/// The data that the process wrote to stdout.
output: ~[u8],
pub output: ~[u8],
/// The data that the process wrote to stderr.
error: ~[u8],
pub error: ~[u8],
}
/// Describes what to do with a standard io stream for a child process.

View File

@ -81,15 +81,15 @@ pub enum Signum {
/// ```
pub struct Listener {
/// A map from signums to handles to keep the handles in memory
priv handles: ~[(Signum, ~RtioSignal)],
handles: ~[(Signum, ~RtioSignal)],
/// This is where all the handles send signums, which are received by
/// the clients from the receiver.
priv tx: Sender<Signum>,
tx: Sender<Signum>,
/// Clients of Listener can `recv()` on this receiver. This is exposed to
/// allow selection over it as well as manipulation of the receiver
/// directly.
rx: Receiver<Signum>,
pub rx: Receiver<Signum>,
}
impl Listener {

View File

@ -293,7 +293,7 @@ pub fn println_args(fmt: &fmt::Arguments) {
/// Representation of a reader of a standard input stream
pub struct StdReader {
priv inner: StdSource
inner: StdSource
}
impl Reader for StdReader {
@ -322,7 +322,7 @@ impl Reader for StdReader {
/// Representation of a writer to a standard output stream
pub struct StdWriter {
priv inner: StdSource
inner: StdSource
}
impl StdWriter {

View File

@ -24,7 +24,7 @@ use sync::atomics;
/// A wrapper for a path to temporary directory implementing automatic
/// scope-based deletion.
pub struct TempDir {
priv path: Option<Path>
path: Option<Path>
}
impl TempDir {

View File

@ -63,7 +63,7 @@ use rt::rtio::{IoFactory, LocalIo, RtioTimer};
/// # }
/// ```
pub struct Timer {
priv obj: ~RtioTimer:Send,
obj: ~RtioTimer:Send,
}
/// Sleep the current task for `msecs` milliseconds.

View File

@ -17,8 +17,8 @@ use slice::bytes::MutableByteVector;
/// Wraps a `Reader`, limiting the number of bytes that can be read from it.
pub struct LimitReader<R> {
priv limit: uint,
priv inner: R
limit: uint,
inner: R
}
impl<R: Reader> LimitReader<R> {
@ -85,7 +85,7 @@ impl Reader for NullReader {
/// A `Writer` which multiplexes writes to a set of `Writers`.
pub struct MultiWriter {
priv writers: ~[~Writer]
writers: ~[~Writer]
}
impl MultiWriter {
@ -118,8 +118,8 @@ impl Writer for MultiWriter {
/// A `Reader` which chains input from multiple `Readers`, reading each to
/// completion before moving onto the next.
pub struct ChainedReader<I, R> {
priv readers: I,
priv cur_reader: Option<R>,
readers: I,
cur_reader: Option<R>,
}
impl<R: Reader, I: Iterator<R>> ChainedReader<I, R> {
@ -156,8 +156,8 @@ impl<R: Reader, I: Iterator<R>> Reader for ChainedReader<I, R> {
/// A `Reader` which forwards input from another `Reader`, passing it along to
/// a `Writer` as well. Similar to the `tee(1)` command.
pub struct TeeReader<R, W> {
priv reader: R,
priv writer: W
reader: R,
writer: W,
}
impl<R: Reader, W: Writer> TeeReader<R, W> {

View File

@ -751,7 +751,7 @@ impl<A, B, T: ExactSize<A>, U: ExactSize<B>> ExactSize<(A, B)> for Zip<T, U> {}
/// An double-ended iterator with the direction inverted
#[deriving(Clone)]
pub struct Rev<T> {
priv iter: T
iter: T
}
impl<A, T: DoubleEndedIterator<A>> Iterator<A> for Rev<T> {
@ -778,7 +778,7 @@ impl<A, T: DoubleEndedIterator<A> + RandomAccessIterator<A>> RandomAccessIterato
/// A mutable reference to an iterator
pub struct ByRef<'a, T> {
priv iter: &'a mut T
iter: &'a mut T
}
impl<'a, A, T: Iterator<A>> Iterator<A> for ByRef<'a, T> {
@ -1036,8 +1036,8 @@ impl<A, T: Clone + Iterator<A>> CloneableIterator for T {
/// An iterator that repeats endlessly
#[deriving(Clone)]
pub struct Cycle<T> {
priv orig: T,
priv iter: T,
orig: T,
iter: T,
}
impl<A, T: Clone + Iterator<A>> Iterator<A> for Cycle<T> {
@ -1087,9 +1087,9 @@ impl<A, T: Clone + RandomAccessIterator<A>> RandomAccessIterator<A> for Cycle<T>
/// An iterator which strings two iterators together
#[deriving(Clone)]
pub struct Chain<T, U> {
priv a: T,
priv b: U,
priv flag: bool
a: T,
b: U,
flag: bool
}
impl<A, T: Iterator<A>, U: Iterator<A>> Iterator<A> for Chain<T, U> {
@ -1156,8 +1156,8 @@ for Chain<T, U> {
/// An iterator which iterates two other iterators simultaneously
#[deriving(Clone)]
pub struct Zip<T, U> {
priv a: T,
priv b: U
a: T,
b: U
}
impl<A, B, T: Iterator<A>, U: Iterator<B>> Iterator<(A, B)> for Zip<T, U> {
@ -1234,8 +1234,8 @@ RandomAccessIterator<(A, B)> for Zip<T, U> {
/// An iterator which maps the values of `iter` with `f`
pub struct Map<'a, A, B, T> {
priv iter: T,
priv f: 'a |A| -> B
iter: T,
f: 'a |A| -> B
}
impl<'a, A, B, T> Map<'a, A, B, T> {
@ -1283,8 +1283,8 @@ impl<'a, A, B, T: RandomAccessIterator<A>> RandomAccessIterator<B> for Map<'a, A
/// An iterator which filters the elements of `iter` with `predicate`
pub struct Filter<'a, A, T> {
priv iter: T,
priv predicate: 'a |&A| -> bool
iter: T,
predicate: 'a |&A| -> bool
}
impl<'a, A, T: Iterator<A>> Iterator<A> for Filter<'a, A, T> {
@ -1327,8 +1327,8 @@ impl<'a, A, T: DoubleEndedIterator<A>> DoubleEndedIterator<A> for Filter<'a, A,
/// An iterator which uses `f` to both filter and map elements from `iter`
pub struct FilterMap<'a, A, B, T> {
priv iter: T,
priv f: 'a |A| -> Option<B>
iter: T,
f: 'a |A| -> Option<B>
}
impl<'a, A, B, T: Iterator<A>> Iterator<B> for FilterMap<'a, A, B, T> {
@ -1371,8 +1371,8 @@ for FilterMap<'a, A, B, T> {
/// An iterator which yields the current count and the element during iteration
#[deriving(Clone)]
pub struct Enumerate<T> {
priv iter: T,
priv count: uint
iter: T,
count: uint
}
impl<A, T: Iterator<A>> Iterator<(uint, A)> for Enumerate<T> {
@ -1425,8 +1425,8 @@ impl<A, T: RandomAccessIterator<A>> RandomAccessIterator<(uint, A)> for Enumerat
/// An iterator with a `peek()` that returns an optional reference to the next element.
pub struct Peekable<A, T> {
priv iter: T,
priv peeked: Option<A>,
iter: T,
peeked: Option<A>,
}
impl<A, T: Iterator<A>> Iterator<A> for Peekable<A, T> {
@ -1475,9 +1475,9 @@ impl<'a, A, T: Iterator<A>> Peekable<A, T> {
/// An iterator which rejects elements while `predicate` is true
pub struct SkipWhile<'a, A, T> {
priv iter: T,
priv flag: bool,
priv predicate: 'a |&A| -> bool
iter: T,
flag: bool,
predicate: 'a |&A| -> bool
}
impl<'a, A, T: Iterator<A>> Iterator<A> for SkipWhile<'a, A, T> {
@ -1513,9 +1513,9 @@ impl<'a, A, T: Iterator<A>> Iterator<A> for SkipWhile<'a, A, T> {
/// An iterator which only accepts elements while `predicate` is true
pub struct TakeWhile<'a, A, T> {
priv iter: T,
priv flag: bool,
priv predicate: 'a |&A| -> bool
iter: T,
flag: bool,
predicate: 'a |&A| -> bool
}
impl<'a, A, T: Iterator<A>> Iterator<A> for TakeWhile<'a, A, T> {
@ -1548,8 +1548,8 @@ impl<'a, A, T: Iterator<A>> Iterator<A> for TakeWhile<'a, A, T> {
/// An iterator which skips over `n` elements of `iter`.
#[deriving(Clone)]
pub struct Skip<T> {
priv iter: T,
priv n: uint
iter: T,
n: uint
}
impl<A, T: Iterator<A>> Iterator<A> for Skip<T> {
@ -1612,8 +1612,8 @@ impl<A, T: RandomAccessIterator<A>> RandomAccessIterator<A> for Skip<T> {
/// An iterator which only iterates over the first `n` iterations of `iter`.
#[deriving(Clone)]
pub struct Take<T> {
priv iter: T,
priv n: uint
iter: T,
n: uint
}
impl<A, T: Iterator<A>> Iterator<A> for Take<T> {
@ -1661,11 +1661,11 @@ impl<A, T: RandomAccessIterator<A>> RandomAccessIterator<A> for Take<T> {
/// An iterator to maintain state while iterating another iterator
pub struct Scan<'a, A, B, T, St> {
priv iter: T,
priv f: 'a |&mut St, A| -> Option<B>,
iter: T,
f: 'a |&mut St, A| -> Option<B>,
/// The current internal state to be passed to the closure next.
state: St
pub state: St,
}
impl<'a, A, B, T: Iterator<A>, St> Iterator<B> for Scan<'a, A, B, T, St> {
@ -1685,10 +1685,10 @@ impl<'a, A, B, T: Iterator<A>, St> Iterator<B> for Scan<'a, A, B, T, St> {
/// and yields the elements of the produced iterators
///
pub struct FlatMap<'a, A, T, U> {
priv iter: T,
priv f: 'a |A| -> U,
priv frontiter: Option<U>,
priv backiter: Option<U>,
iter: T,
f: 'a |A| -> U,
frontiter: Option<U>,
backiter: Option<U>,
}
impl<'a, A, T: Iterator<A>, B, U: Iterator<B>> Iterator<B> for FlatMap<'a, A, T, U> {
@ -1744,8 +1744,8 @@ impl<'a,
/// yields `None` once.
#[deriving(Clone)]
pub struct Fuse<T> {
priv iter: T,
priv done: bool
iter: T,
done: bool
}
impl<A, T: Iterator<A>> Iterator<A> for Fuse<T> {
@ -1816,8 +1816,8 @@ impl<T> Fuse<T> {
/// An iterator that calls a function with a reference to each
/// element before yielding it.
pub struct Inspect<'a, A, T> {
priv iter: T,
priv f: 'a |&A|
iter: T,
f: 'a |&A|
}
impl<'a, A, T> Inspect<'a, A, T> {
@ -1869,9 +1869,9 @@ for Inspect<'a, A, T> {
/// An iterator which just modifies the contained state throughout iteration.
pub struct Unfold<'a, A, St> {
priv f: 'a |&mut St| -> Option<A>,
f: 'a |&mut St| -> Option<A>,
/// Internal state that will be yielded on the next iteration
state: St
pub state: St,
}
impl<'a, A, St> Unfold<'a, A, St> {
@ -1905,9 +1905,9 @@ impl<'a, A, St> Iterator<A> for Unfold<'a, A, St> {
#[deriving(Clone)]
pub struct Counter<A> {
/// The current state the counter is at (next value to be yielded)
priv state: A,
state: A,
/// The amount that this iterator is stepping by
priv step: A
step: A,
}
/// Creates a new counter with the specified start/step
@ -1933,9 +1933,9 @@ impl<A: Add<A, A> + Clone> Iterator<A> for Counter<A> {
/// An iterator over the range [start, stop)
#[deriving(Clone)]
pub struct Range<A> {
priv state: A,
priv stop: A,
priv one: A
state: A,
stop: A,
one: A
}
/// Return an iterator over the range [start, stop)
@ -2007,8 +2007,8 @@ impl<A: Int + Ord + Clone + ToPrimitive> DoubleEndedIterator<A> for Range<A> {
/// An iterator over the range [start, stop]
#[deriving(Clone)]
pub struct RangeInclusive<A> {
priv range: Range<A>,
priv done: bool
range: Range<A>,
done: bool,
}
/// Return an iterator over the range [start, stop]
@ -2070,10 +2070,10 @@ impl<A: Sub<A, A> + Int + Ord + Clone + ToPrimitive> DoubleEndedIterator<A>
/// An iterator over the range [start, stop) by `step`. It handles overflow by stopping.
#[deriving(Clone)]
pub struct RangeStep<A> {
priv state: A,
priv stop: A,
priv step: A,
priv rev: bool
state: A,
stop: A,
step: A,
rev: bool,
}
/// Return an iterator over the range [start, stop) by `step`. It handles overflow by stopping.
@ -2102,11 +2102,11 @@ impl<A: CheckedAdd + Ord + Clone> Iterator<A> for RangeStep<A> {
/// An iterator over the range [start, stop] by `step`. It handles overflow by stopping.
#[deriving(Clone)]
pub struct RangeStepInclusive<A> {
priv state: A,
priv stop: A,
priv step: A,
priv rev: bool,
priv done: bool
state: A,
stop: A,
step: A,
rev: bool,
done: bool,
}
/// Return an iterator over the range [start, stop] by `step`. It handles overflow by stopping.
@ -2137,7 +2137,7 @@ impl<A: CheckedAdd + Ord + Clone + Eq> Iterator<A> for RangeStepInclusive<A> {
/// An iterator that repeats an element endlessly
#[deriving(Clone)]
pub struct Repeat<A> {
priv element: A
element: A
}
impl<A: Clone> Repeat<A> {

View File

@ -193,7 +193,7 @@ pub mod marker {
/// "interior" mutability:
///
/// ```
/// pub struct Cell<T> { priv value: T }
/// pub struct Cell<T> { value: T }
/// # fn main() {}
/// ```
///

View File

@ -57,7 +57,9 @@
// Don't link to std. We are std.
#![no_std]
#![deny(missing_doc)]
// #![deny(missing_doc)] // NOTE: uncomment after a stage0 snap
#![allow(missing_doc)] // NOTE: remove after a stage0 snap
#![allow(visible_private_types)] // NOTE: remove after a stage0 snap
// When testing libstd, bring in libuv as the I/O backend so tests can print
// things and all of the std::io tests have an I/O interface to run on top

File diff suppressed because it is too large Load Diff

View File

@ -535,7 +535,7 @@ impl<T> Default for Option<T> {
/// methods on `Option`.
#[deriving(Clone)]
pub struct Item<A> {
priv opt: Option<A>
opt: Option<A>
}
impl<A> Iterator<A> for Item<A> {

View File

@ -370,10 +370,10 @@ pub fn unsetenv(n: &str) {
pub struct Pipe {
/// A file descriptor representing the reading end of the pipe. Data written
/// on the `out` file descriptor can be read from this file descriptor.
input: c_int,
pub input: c_int,
/// A file descriptor representing the write end of the pipe. Data written
/// to this file descriptor can be read from the `input` file descriptor.
out: c_int,
pub out: c_int,
}
/// Creates a new low-level OS in-memory pipe.
@ -946,11 +946,11 @@ pub fn page_size() -> uint {
/// let it leave scope by accident if you want it to stick around.
pub struct MemoryMap {
/// Pointer to the memory created or modified by this map.
data: *mut u8,
pub data: *mut u8,
/// Number of bytes this map applies to
len: uint,
pub len: uint,
/// Type of mapping
kind: MemoryMapKind
pub kind: MemoryMapKind,
}
/// Type of memory map

View File

@ -488,8 +488,8 @@ pub trait GenericPathUnsafe {
/// Helper struct for printing paths with format!()
pub struct Display<'a, P> {
priv path: &'a P,
priv filename: bool
path: &'a P,
filename: bool
}
impl<'a, P: GenericPath> fmt::Show for Display<'a, P> {

View File

@ -40,8 +40,8 @@ pub type RevStrComponents<'a> = Map<'a, &'a [u8], Option<&'a str>,
/// Represents a POSIX file path
#[deriving(Clone)]
pub struct Path {
priv repr: ~[u8], // assumed to never be empty or contain NULs
priv sepidx: Option<uint> // index of the final separator in repr
repr: ~[u8], // assumed to never be empty or contain NULs
sepidx: Option<uint> // index of the final separator in repr
}
/// The standard path separator character

View File

@ -81,9 +81,9 @@ pub type RevComponents<'a> = Map<'a, Option<&'a str>, &'a [u8],
// preserved by the data structure; let the Windows API error out on them.
#[deriving(Clone)]
pub struct Path {
priv repr: ~str, // assumed to never be empty
priv prefix: Option<PathPrefix>,
priv sepidx: Option<uint> // index of the final separator in the non-prefix portion of repr
repr: ~str, // assumed to never be empty
prefix: Option<PathPrefix>,
sepidx: Option<uint> // index of the final separator in the non-prefix portion of repr
}
impl Eq for Path {

View File

@ -21,18 +21,18 @@ use cast;
/// The representation of a Rust managed box
pub struct Box<T> {
ref_count: uint,
drop_glue: fn(ptr: *mut u8),
prev: *mut Box<T>,
next: *mut Box<T>,
data: T
pub ref_count: uint,
pub drop_glue: fn(ptr: *mut u8),
pub prev: *mut Box<T>,
pub next: *mut Box<T>,
pub data: T,
}
/// The representation of a Rust vector
pub struct Vec<T> {
fill: uint,
alloc: uint,
data: T
pub fill: uint,
pub alloc: uint,
pub data: T,
}
/// The representation of a Rust string
@ -40,20 +40,20 @@ pub type String = Vec<u8>;
/// The representation of a Rust slice
pub struct Slice<T> {
data: *T,
len: uint
pub data: *T,
pub len: uint,
}
/// The representation of a Rust closure
pub struct Closure {
code: *(),
env: *(),
pub code: *(),
pub env: *(),
}
/// The representation of a Rust procedure (`proc()`)
pub struct Procedure {
code: *(),
env: *(),
pub code: *(),
pub env: *(),
}
/// The representation of a Rust trait object.
@ -61,8 +61,8 @@ pub struct Procedure {
/// This struct does not have a `Repr` implementation
/// because there is no way to refer to all trait objects generically.
pub struct TraitObject {
vtable: *(),
data: *(),
pub vtable: *(),
pub data: *(),
}
/// This trait is meant to map equivalences between raw structs and their

View File

@ -43,9 +43,9 @@ struct RcBox<T> {
/// Immutable reference counted pointer type
#[unsafe_no_drop_flag]
pub struct Rc<T> {
priv ptr: *mut RcBox<T>,
priv nosend: marker::NoSend,
priv noshare: marker::NoShare
ptr: *mut RcBox<T>,
nosend: marker::NoSend,
noshare: marker::NoShare
}
impl<T> Rc<T> {
@ -151,9 +151,9 @@ impl<T: TotalOrd> TotalOrd for Rc<T> {
/// Weak reference to a reference-counted box
#[unsafe_no_drop_flag]
pub struct Weak<T> {
priv ptr: *mut RcBox<T>,
priv nosend: marker::NoSend,
priv noshare: marker::NoShare
ptr: *mut RcBox<T>,
nosend: marker::NoSend,
noshare: marker::NoShare
}
impl<T> Weak<T> {

View File

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

View File

@ -101,11 +101,11 @@ enum VariantState {
}
pub struct ReprVisitor<'a> {
priv ptr: *u8,
priv ptr_stk: ~[*u8],
priv var_stk: ~[VariantState],
priv writer: &'a mut io::Writer,
priv last_err: Option<io::IoError>,
ptr: *u8,
ptr_stk: ~[*u8],
var_stk: ~[VariantState],
writer: &'a mut io::Writer,
last_err: Option<io::IoError>,
}
pub fn ReprVisitor<'a>(ptr: *u8,

View File

@ -17,8 +17,7 @@ use libc;
#[cfg(not(target_arch = "arm"))]
#[repr(C)]
pub enum _Unwind_Action
{
pub enum _Unwind_Action {
_UA_SEARCH_PHASE = 1,
_UA_CLEANUP_PHASE = 2,
_UA_HANDLER_FRAME = 4,
@ -28,14 +27,13 @@ pub enum _Unwind_Action
#[cfg(target_arch = "arm")]
#[repr(C)]
pub enum _Unwind_State
{
_US_VIRTUAL_UNWIND_FRAME = 0,
_US_UNWIND_FRAME_STARTING = 1,
_US_UNWIND_FRAME_RESUME = 2,
_US_ACTION_MASK = 3,
_US_FORCE_UNWIND = 8,
_US_END_OF_STACK = 16
pub enum _Unwind_State {
_US_VIRTUAL_UNWIND_FRAME = 0,
_US_UNWIND_FRAME_STARTING = 1,
_US_UNWIND_FRAME_RESUME = 2,
_US_ACTION_MASK = 3,
_US_FORCE_UNWIND = 8,
_US_END_OF_STACK = 16
}
#[repr(C)]
@ -69,9 +67,9 @@ pub static unwinder_private_data_size: int = 20;
pub static unwinder_private_data_size: int = 2;
pub struct _Unwind_Exception {
exception_class: _Unwind_Exception_Class,
exception_cleanup: _Unwind_Exception_Cleanup_Fn,
private: [_Unwind_Word, ..unwinder_private_data_size],
pub exception_class: _Unwind_Exception_Class,
pub exception_cleanup: _Unwind_Exception_Cleanup_Fn,
pub private: [_Unwind_Word, ..unwinder_private_data_size],
}
pub enum _Unwind_Context {}

View File

@ -33,14 +33,14 @@ static MAGIC: u32 = 0xbadc0ffe;
pub type Box = raw::Box<()>;
pub struct MemoryRegion {
priv allocations: Vec<*AllocHeader>,
priv live_allocations: uint,
allocations: Vec<*AllocHeader>,
live_allocations: uint,
}
pub struct LocalHeap {
priv memory_region: MemoryRegion,
memory_region: MemoryRegion,
priv live_allocs: *mut raw::Box<()>,
live_allocs: *mut raw::Box<()>,
}
impl LocalHeap {

View File

@ -31,7 +31,7 @@ pub use self::compiled::*;
/// Encapsulates a borrowed value. When this value goes out of scope, the
/// pointer is returned.
pub struct Borrowed<T> {
priv val: *(),
val: *(),
}
#[unsafe_destructor]

View File

@ -61,11 +61,11 @@ pub trait RemoteCallback {
/// libuv (it does translation to windows under the hood).
pub struct FileOpenConfig {
/// Path to file to be opened
path: Path,
pub path: Path,
/// Flags for file access mode (as per open(2))
flags: int,
pub flags: int,
/// File creation mode, ignored unless O_CREAT is passed as part of flags
priv mode: int
pub mode: int
}
/// Description of what to do when a file handle is closed
@ -83,7 +83,7 @@ pub enum CloseBehavior {
}
pub struct LocalIo<'a> {
priv factory: &'a mut IoFactory,
factory: &'a mut IoFactory,
}
#[unsafe_destructor]

View File

@ -43,18 +43,18 @@ use unstable::finally::Finally;
/// in the struct. This contains a pointer to another struct that holds
/// the type-specific state.
pub struct Task {
heap: LocalHeap,
gc: GarbageCollector,
storage: LocalStorage,
unwinder: Unwinder,
death: Death,
destroyed: bool,
name: Option<SendStr>,
pub heap: LocalHeap,
pub gc: GarbageCollector,
pub storage: LocalStorage,
pub unwinder: Unwinder,
pub death: Death,
pub destroyed: bool,
pub name: Option<SendStr>,
stdout: Option<~Writer:Send>,
stderr: Option<~Writer:Send>,
pub stdout: Option<~Writer:Send>,
pub stderr: Option<~Writer:Send>,
priv imp: Option<~Runtime:Send>,
imp: Option<~Runtime:Send>,
}
pub struct GarbageCollector;
@ -77,11 +77,11 @@ pub enum DeathAction {
/// Per-task state related to task death, killing, failure, etc.
pub struct Death {
on_exit: Option<DeathAction>,
pub on_exit: Option<DeathAction>,
}
pub struct BlockedTasks {
priv inner: UnsafeArc<AtomicUint>,
inner: UnsafeArc<AtomicUint>,
}
impl Task {

View File

@ -28,9 +28,9 @@ type StartFn = extern "C" fn(*libc::c_void) -> imp::rust_thread_return;
/// This struct represents a native thread's state. This is used to join on an
/// existing thread created in the join-able state.
pub struct Thread<T> {
priv native: imp::rust_thread,
priv joined: bool,
priv packet: ~Option<T>,
native: imp::rust_thread,
joined: bool,
packet: ~Option<T>,
}
static DEFAULT_STACK_SIZE: uint = 1024 * 1024;

View File

@ -75,8 +75,8 @@ use intrinsics;
use uw = rt::libunwind;
pub struct Unwinder {
priv unwinding: bool,
priv cause: Option<~Any:Send>
unwinding: bool,
cause: Option<~Any:Send>
}
impl Unwinder {

View File

@ -233,10 +233,10 @@ pub fn mut_ref_slice<'a, A>(s: &'a mut A) -> &'a mut [A] {
/// An iterator over the slices of a vector separated by elements that
/// match a predicate function.
pub struct Splits<'a, T> {
priv v: &'a [T],
priv n: uint,
priv pred: 'a |t: &T| -> bool,
priv finished: bool
v: &'a [T],
n: uint,
pred: 'a |t: &T| -> bool,
finished: bool
}
impl<'a, T> Iterator<&'a [T]> for Splits<'a, T> {
@ -282,10 +282,10 @@ impl<'a, T> Iterator<&'a [T]> for Splits<'a, T> {
/// An iterator over the slices of a vector separated by elements that
/// match a predicate function, from back to front.
pub struct RevSplits<'a, T> {
priv v: &'a [T],
priv n: uint,
priv pred: 'a |t: &T| -> bool,
priv finished: bool
v: &'a [T],
n: uint,
pred: 'a |t: &T| -> bool,
finished: bool
}
impl<'a, T> Iterator<&'a [T]> for RevSplits<'a, T> {
@ -411,9 +411,9 @@ pub fn unzip<T, U, V: Iterator<(T, U)>>(mut iter: V) -> (~[T], ~[U]) {
/// The last generated swap is always (0, 1), and it returns the
/// sequence to its initial order.
pub struct ElementSwaps {
priv sdir: ~[SizeDirection],
sdir: ~[SizeDirection],
/// If true, emit the last swap that returns the sequence to initial state
priv emit_reset: bool,
emit_reset: bool,
}
impl ElementSwaps {
@ -486,8 +486,8 @@ impl Iterator<(uint, uint)> for ElementSwaps {
///
/// Generates even and odd permutations alternately.
pub struct Permutations<T> {
priv swaps: ElementSwaps,
priv v: ~[T],
swaps: ElementSwaps,
v: ~[T],
}
impl<T: Clone> Iterator<~[T]> for Permutations<T> {
@ -508,8 +508,8 @@ impl<T: Clone> Iterator<~[T]> for Permutations<T> {
/// a vector.
#[deriving(Clone)]
pub struct Windows<'a, T> {
priv v: &'a [T],
priv size: uint
v: &'a [T],
size: uint
}
impl<'a, T> Iterator<&'a [T]> for Windows<'a, T> {
@ -542,8 +542,8 @@ impl<'a, T> Iterator<&'a [T]> for Windows<'a, T> {
/// the last slice of the iteration will be the remainder.
#[deriving(Clone)]
pub struct Chunks<'a, T> {
priv v: &'a [T],
priv size: uint
v: &'a [T],
size: uint
}
impl<'a, T> Iterator<&'a [T]> for Chunks<'a, T> {
@ -2632,17 +2632,17 @@ impl<A> Default for ~[A] {
/// Immutable slice iterator
pub struct Items<'a, T> {
priv ptr: *T,
priv end: *T,
priv marker: marker::ContravariantLifetime<'a>
ptr: *T,
end: *T,
marker: marker::ContravariantLifetime<'a>
}
/// Mutable slice iterator
pub struct MutItems<'a, T> {
priv ptr: *mut T,
priv end: *mut T,
priv marker: marker::ContravariantLifetime<'a>,
priv marker2: marker::NoCopy
ptr: *mut T,
end: *mut T,
marker: marker::ContravariantLifetime<'a>,
marker2: marker::NoCopy
}
macro_rules! iterator {
@ -2735,9 +2735,9 @@ pub type RevMutItems<'a, T> = Rev<MutItems<'a, T>>;
/// An iterator over the subslices of the vector which are separated
/// by elements that match `pred`.
pub struct MutSplits<'a, T> {
priv v: &'a mut [T],
priv pred: 'a |t: &T| -> bool,
priv finished: bool
v: &'a mut [T],
pred: 'a |t: &T| -> bool,
finished: bool
}
impl<'a, T> Iterator<&'a mut [T]> for MutSplits<'a, T> {
@ -2800,8 +2800,8 @@ impl<'a, T> DoubleEndedIterator<&'a mut [T]> for MutSplits<'a, T> {
/// the vector len is not evenly divided by the chunk size, the last slice of the iteration will be
/// the remainder.
pub struct MutChunks<'a, T> {
priv v: &'a mut [T],
priv chunk_size: uint
v: &'a mut [T],
chunk_size: uint
}
impl<'a, T> Iterator<&'a mut [T]> for MutChunks<'a, T> {
@ -2849,8 +2849,8 @@ impl<'a, T> DoubleEndedIterator<&'a mut [T]> for MutChunks<'a, T> {
/// An iterator that moves out of a vector.
pub struct MoveItems<T> {
priv allocation: *mut u8, // the block of memory allocated for the vector
priv iter: Items<'static, T>
allocation: *mut u8, // the block of memory allocated for the vector
iter: Items<'static, T>
}
impl<T> Iterator<T> for MoveItems<T> {

View File

@ -275,7 +275,7 @@ Section: Iterators
#[deriving(Clone)]
pub struct Chars<'a> {
/// The slice remaining to be iterated
priv string: &'a str,
string: &'a str,
}
impl<'a> Iterator<char> for Chars<'a> {
@ -320,8 +320,8 @@ impl<'a> DoubleEndedIterator<char> for Chars<'a> {
#[deriving(Clone)]
pub struct CharOffsets<'a> {
/// The original string to be iterated
priv string: &'a str,
priv iter: Chars<'a>,
string: &'a str,
iter: Chars<'a>,
}
impl<'a> Iterator<(uint, char)> for CharOffsets<'a> {
@ -371,12 +371,12 @@ pub type RevBytes<'a> = Rev<Bytes<'a>>;
#[deriving(Clone)]
pub struct CharSplits<'a, Sep> {
/// The slice remaining to be iterated
priv string: &'a str,
priv sep: Sep,
string: &'a str,
sep: Sep,
/// Whether an empty string at the end is allowed
priv allow_trailing_empty: bool,
priv only_ascii: bool,
priv finished: bool,
allow_trailing_empty: bool,
only_ascii: bool,
finished: bool,
}
/// An iterator over the substrings of a string, separated by `sep`,
@ -387,10 +387,10 @@ pub type RevCharSplits<'a, Sep> = Rev<CharSplits<'a, Sep>>;
/// splitting at most `count` times.
#[deriving(Clone)]
pub struct CharSplitsN<'a, Sep> {
priv iter: CharSplits<'a, Sep>,
iter: CharSplits<'a, Sep>,
/// The number of splits remaining
priv count: uint,
priv invert: bool,
count: uint,
invert: bool,
}
/// An iterator over the words of a string, separated by a sequence of whitespace
@ -503,18 +503,18 @@ impl<'a, Sep: CharEq> Iterator<&'a str> for CharSplitsN<'a, Sep> {
/// substring within a larger string
#[deriving(Clone)]
pub struct MatchIndices<'a> {
priv haystack: &'a str,
priv needle: &'a str,
priv position: uint,
haystack: &'a str,
needle: &'a str,
position: uint,
}
/// An iterator over the substrings of a string separated by a given
/// search string
#[deriving(Clone)]
pub struct StrSplits<'a> {
priv it: MatchIndices<'a>,
priv last_end: uint,
priv finished: bool
it: MatchIndices<'a>,
last_end: uint,
finished: bool
}
impl<'a> Iterator<(uint, uint)> for MatchIndices<'a> {
@ -597,10 +597,10 @@ enum NormalizationForm {
/// Use with the `std::iter` module.
#[deriving(Clone)]
pub struct Normalizations<'a> {
priv kind: NormalizationForm,
priv iter: Chars<'a>,
priv buffer: ~[(char, u8)],
priv sorted: bool
kind: NormalizationForm,
iter: Chars<'a>,
buffer: ~[(char, u8)],
sorted: bool
}
impl<'a> Iterator<char> for Normalizations<'a> {
@ -856,7 +856,7 @@ pub fn is_utf16(v: &[u16]) -> bool {
/// of `u16`s.
#[deriving(Clone)]
pub struct UTF16Items<'a> {
priv iter: slice::Items<'a, u16>
iter: slice::Items<'a, u16>
}
/// The possibilities for values decoded from a `u16` stream.
#[deriving(Eq, TotalEq, Clone, Show)]
@ -1061,9 +1061,9 @@ pub fn utf8_char_width(b: u8) -> uint {
/// for iterating over the UTF-8 bytes of a string.
pub struct CharRange {
/// Current `char`
ch: char,
pub ch: char,
/// Index of the first byte of the next `char`
next: uint
pub next: uint,
}
// Return the initial codepoint accumulator for the first byte.

View File

@ -35,7 +35,7 @@ use ty::Unsafe;
/// Enforces no shared-memory safety.
#[unsafe_no_drop_flag]
pub struct UnsafeArc<T> {
priv data: *mut ArcData<T>,
data: *mut ArcData<T>,
}
struct ArcData<T> {

View File

@ -116,26 +116,26 @@ use ty::Unsafe;
/// An atomic boolean type.
pub struct AtomicBool {
priv v: Unsafe<uint>,
priv nocopy: marker::NoCopy
v: Unsafe<uint>,
nocopy: marker::NoCopy
}
/// A signed atomic integer type, supporting basic atomic arithmetic operations
pub struct AtomicInt {
priv v: Unsafe<int>,
priv nocopy: marker::NoCopy
v: Unsafe<int>,
nocopy: marker::NoCopy
}
/// An unsigned atomic integer type, supporting basic atomic arithmetic operations
pub struct AtomicUint {
priv v: Unsafe<uint>,
priv nocopy: marker::NoCopy
v: Unsafe<uint>,
nocopy: marker::NoCopy
}
/// An unsafe atomic pointer. Only supports basic atomic operations
pub struct AtomicPtr<T> {
priv p: Unsafe<uint>,
priv nocopy: marker::NoCopy
p: Unsafe<uint>,
nocopy: marker::NoCopy
}
/// An atomic, nullable unique pointer
@ -144,7 +144,7 @@ pub struct AtomicPtr<T> {
/// owned heap objects across tasks.
#[unsafe_no_drop_flag]
pub struct AtomicOption<T> {
priv p: Unsafe<uint>,
p: Unsafe<uint>,
}
/// Atomic memory orderings

View File

@ -86,14 +86,14 @@ struct Deque<T> {
///
/// There may only be one worker per deque.
pub struct Worker<T> {
priv deque: UnsafeArc<Deque<T>>,
deque: UnsafeArc<Deque<T>>,
}
/// The stealing half of the work-stealing deque. Stealers have access to the
/// opposite end of the deque from the worker, and they only have access to the
/// `steal` method.
pub struct Stealer<T> {
priv deque: UnsafeArc<Deque<T>>,
deque: UnsafeArc<Deque<T>>,
}
/// When stealing some data, this is an enumeration of the possible outcomes.
@ -116,7 +116,7 @@ pub enum Stolen<T> {
/// will only use this structure when allocating a new buffer or deallocating a
/// previous one.
pub struct BufferPool<T> {
priv pool: Exclusive<~[~Buffer<T>]>,
pool: Exclusive<~[~Buffer<T>]>,
}
/// An internal buffer used by the chase-lev deque. This structure is actually

View File

@ -54,7 +54,7 @@ struct State<T> {
}
pub struct Queue<T> {
priv state: UnsafeArc<State<T>>,
state: UnsafeArc<State<T>>,
}
impl<T: Send> State<T> {

View File

@ -67,8 +67,8 @@ struct Node<T> {
/// may be safely shared so long as it is guaranteed that there is only one
/// popper at a time (many pushers are allowed).
pub struct Queue<T> {
priv head: AtomicPtr<Node<T>>,
priv tail: *mut Node<T>,
head: AtomicPtr<Node<T>>,
tail: *mut Node<T>,
}
impl<T> Node<T> {

View File

@ -55,19 +55,19 @@ struct Node<T> {
/// time.
pub struct Queue<T> {
// consumer fields
priv tail: *mut Node<T>, // where to pop from
priv tail_prev: AtomicPtr<Node<T>>, // where to pop from
tail: *mut Node<T>, // where to pop from
tail_prev: AtomicPtr<Node<T>>, // where to pop from
// producer fields
priv head: *mut Node<T>, // where to push to
priv first: *mut Node<T>, // where to get new nodes from
priv tail_copy: *mut Node<T>, // between first/tail
head: *mut Node<T>, // where to push to
first: *mut Node<T>, // where to get new nodes from
tail_copy: *mut Node<T>, // between first/tail
// Cache maintenance fields. Additions and subtractions are stored
// separately in order to allow them to use nonatomic addition/subtraction.
priv cache_bound: uint,
priv cache_additions: AtomicUint,
priv cache_subtractions: AtomicUint,
cache_bound: uint,
cache_additions: AtomicUint,
cache_subtractions: AtomicUint,
}
impl<T: Send> Node<T> {

View File

@ -60,15 +60,15 @@ pub type TaskResult = Result<(), ~Any:Send>;
/// Task configuration options
pub struct TaskOpts {
/// Enable lifecycle notifications on the given channel
notify_chan: Option<Sender<TaskResult>>,
pub notify_chan: Option<Sender<TaskResult>>,
/// A name for the task-to-be, for identification in failure messages
name: Option<SendStr>,
pub name: Option<SendStr>,
/// The size of the stack for the spawned task
stack_size: Option<uint>,
pub stack_size: Option<uint>,
/// Task-local stdout
stdout: Option<~Writer:Send>,
pub stdout: Option<~Writer:Send>,
/// Task-local stderr
stderr: Option<~Writer:Send>,
pub stderr: Option<~Writer:Send>,
}
/**
@ -85,9 +85,9 @@ pub struct TaskOpts {
// the run function move them in.
pub struct TaskBuilder {
/// Options to spawn the new task with
opts: TaskOpts,
priv gen_body: Option<proc:Send(v: proc:Send()) -> proc:Send()>,
priv nocopy: Option<marker::NoCopy>,
pub opts: TaskOpts,
gen_body: Option<proc:Send(v: proc:Send()) -> proc:Send()>,
nocopy: Option<marker::NoCopy>,
}
/**

View File

@ -48,10 +48,10 @@ use kinds::marker;
#[lang="unsafe"]
pub struct Unsafe<T> {
/// Wrapped value
value: T,
pub value: T,
/// Invariance marker
marker1: marker::InvariantType<T>
pub marker1: marker::InvariantType<T>
}
impl<T> Unsafe<T> {

View File

@ -22,7 +22,7 @@ use ops::*;
use option::*;
use result::*;
pub struct DynamicLibrary { priv handle: *u8}
pub struct DynamicLibrary { handle: *u8}
impl Drop for DynamicLibrary {
fn drop(&mut self) {

View File

@ -67,7 +67,7 @@ use ops::Drop;
/// Prefer the `NativeMutex` type where possible, since that does not
/// require manual deallocation.
pub struct StaticNativeMutex {
priv inner: imp::Mutex,
inner: imp::Mutex,
}
/// A native mutex with a destructor for clean-up.
@ -75,7 +75,7 @@ pub struct StaticNativeMutex {
/// See `StaticNativeMutex` for a version that is suitable for storing in
/// statics.
pub struct NativeMutex {
priv inner: StaticNativeMutex
inner: StaticNativeMutex
}
/// Automatically unlocks the mutex that it was created from on
@ -86,7 +86,7 @@ pub struct NativeMutex {
/// then.
#[must_use]
pub struct LockGuard<'a> {
priv lock: &'a StaticNativeMutex
lock: &'a StaticNativeMutex
}
pub static NATIVE_MUTEX_INIT: StaticNativeMutex = StaticNativeMutex {
@ -372,8 +372,8 @@ mod imp {
}
pub struct Mutex {
priv lock: Unsafe<pthread_mutex_t>,
priv cond: Unsafe<pthread_cond_t>,
lock: Unsafe<pthread_mutex_t>,
cond: Unsafe<pthread_cond_t>,
}
pub static MUTEX_INIT: Mutex = Mutex {
@ -447,8 +447,8 @@ mod imp {
pub struct Mutex {
// pointers for the lock/cond handles, atomically updated
priv lock: atomics::AtomicUint,
priv cond: atomics::AtomicUint,
lock: atomics::AtomicUint,
cond: atomics::AtomicUint,
}
pub static MUTEX_INIT: Mutex = Mutex {

View File

@ -30,7 +30,7 @@ struct ExData<T> {
* need to block or deschedule while accessing shared state, use extra::sync::RWArc.
*/
pub struct Exclusive<T> {
priv x: UnsafeArc<ExData<T>>
x: UnsafeArc<ExData<T>>
}
impl<T:Send> Clone for Exclusive<T> {

View File

@ -56,9 +56,9 @@ use slice::{MutableTotalOrdVector, Vector};
/// ```
#[unsafe_no_drop_flag]
pub struct Vec<T> {
priv len: uint,
priv cap: uint,
priv ptr: *mut T
len: uint,
cap: uint,
ptr: *mut T
}
impl<T> Vec<T> {
@ -1308,8 +1308,8 @@ impl<T:fmt::Show> fmt::Show for Vec<T> {
/// An iterator that moves out of a vector.
pub struct MoveItems<T> {
priv allocation: *mut c_void, // the block of memory allocated for the vector
priv iter: Items<'static, T>
allocation: *mut c_void, // the block of memory allocated for the vector
iter: Items<'static, T>
}
impl<T> Iterator<T> for MoveItems<T> {