/// As sync::condvar, a mechanism for unlock-and-descheduling and signaling.
pub struct Condvar<'self> {
- // all were already priv
priv is_mutex: bool,
priv failed: &'self mut bool,
priv cond: &'self sync::Condvar<'self>
****************************************************************************/
/// An atomically reference counted wrapper for shared immutable state.
-// all were already priv
pub struct Arc<T> { priv x: UnsafeArc<T> }
/// An Arc with mutable data protected by a blocking mutex.
#[no_freeze]
-//All were already priv
pub struct MutexArc<T> { priv x: UnsafeArc<MutexArcInner<T>> }
*/
#[no_freeze]
pub struct RWArc<T> {
- // all were already priv
priv x: UnsafeArc<RWArcInner<T>>,
}
/// The "write permission" token used for RWArc.write_downgrade().
pub struct RWWriteMode<'self, T> {
-/// reedlepee added priv in all the feilds below
priv data: &'self mut T,
priv token: sync::RWLockWriteMode<'self>,
priv poison: PoisonOnFail,
/// The "read permission" token used for RWArc.write_downgrade().
pub struct RWReadMode<'self, T> {
-/// reedlepee added priv in all the feilds below
priv data: &'self T,
priv token: sync::RWLockReadMode<'self>,
}
// The head is separated out from the list as a unbenchmarked
// microoptimization, to avoid needing to case on the list to
// access the head.
-/// no change by reedlepee all were already priv
priv head: Chunk,
priv pod_head: Chunk,
priv chunks: @mut MutList<Chunk>,
/// Contains configuration parameters for `to_base64`.
pub struct Config {
- /// all were made priv by reedlepee
/// Character set to use
priv char_set: CharacterSet,
/// True to pad output with `=` characters
/// The bitvector type
#[deriving(Clone)]
pub struct Bitv {
- /// all were made priv by reedlepee
/// Internal representation of the bit vector (small or large)
priv rep: BitvVariant,
/// The number of valid bits in the internal representation
/// An iterator for `Bitv`.
pub struct BitvIterator<'self> {
- /// all were already priv
priv bitv: &'self Bitv,
priv next_idx: uint,
priv end_idx: uint,
/// as a `uint`.
#[deriving(Clone)]
pub struct BitvSet {
- // all were already priv!!
priv size: uint,
// In theory this is a `Bitv` instead of always a `BigBitv`, but knowing that
}
pub struct BitvSetIterator<'self> {
- // all were already priv
priv set: &'self BitvSet,
priv next_idx: uint
}
* The type representing a foreign chunk of memory
*/
pub struct CVec<T> {
- /// No change all were allready priv!!
priv base: *mut T,
priv len: uint,
priv rsrc: @DtorRes,
/// An extension of `pipes::stream` that allows both sending and receiving.
pub struct DuplexStream<T, U> {
-// all were already priv
priv chan: Chan<T>,
priv port: Port<U>,
}
// all were already priv
pub struct SyncChan<T> { priv duplex_stream: DuplexStream<T, ()> }
/// An extension of `pipes::stream` that acknowledges each message received.
-// all were already priv
pub struct SyncPort<T> { priv duplex_stream: DuplexStream<(), T> }
impl<T: Send> GenericChan<T> for SyncChan<T> {
/// A fixed size buffer of 64 bytes useful for cryptographic operations.
pub struct FixedBuffer64 {
- // already priv
priv buffer: [u8, ..64],
priv buffer_idx: uint,
}
/// A fixed size buffer of 128 bytes useful for cryptographic operations.
pub struct FixedBuffer128 {
- // already priv
priv buffer: [u8, ..128],
priv buffer_idx: uint,
}
/// The MD5 Digest algorithm
pub struct Md5 {
- // already priv
priv length_bytes: u64,
priv buffer: FixedBuffer64,
priv state: Md5State,
/// Structure representing the state of a Sha1 computation
pub struct Sha1 {
- // already priv
priv h: [u32, ..DIGEST_BUF_LEN],
priv length_bits: u64,
priv buffer: FixedBuffer64,
/// The SHA-512 hash algorithm
pub struct Sha512 {
- // already priv
priv engine: Engine512
}
/// The SHA-384 hash algorithm
pub struct Sha384 {
- // already priv
priv engine: Engine512
}
/// The SHA-512 hash algorithm with digest truncated to 256 bits
pub struct Sha512Trunc256 {
- // already priv
priv engine: Engine512
}
/// The SHA-512 hash algorithm with digest truncated to 224 bits
pub struct Sha512Trunc224 {
- // already priv
priv engine: Engine512
}
/// The SHA-256 hash algorithm
pub struct Sha256 {
- // already priv
priv engine: Engine256
}
/// The SHA-224 hash algorithm
pub struct Sha224 {
- // already priv
priv engine: Engine256
}
/// A doubly-linked list.
pub struct DList<T> {
- // all were already priv
priv length: uint,
priv list_head: Link<T>,
priv list_tail: Rawlink<Node<T>>,
/// Double-ended DList iterator
#[deriving(Clone)]
pub struct DListIterator<'self, T> {
- // all were already priv
priv head: &'self Link<T>,
priv tail: Rawlink<Node<T>>,
priv nelem: uint,
/// Double-ended mutable DList iterator
pub struct MutDListIterator<'self, T> {
- // all were already priv
priv list: &'self mut DList<T>,
priv head: Rawlink<Node<T>>,
priv tail: Rawlink<Node<T>>,
/// DList consuming iterator
#[deriving(Clone)]
pub struct MoveIterator<T> {
- // all were already priv
priv list: DList<T>
}
#[deriving(Clone)]
pub struct Doc {
- // all these should be public
data: @~[u8],
start: uint,
end: uint,
}
pub struct TaggedDoc {
- // was made privv by reedlepee
priv tag: uint,
- // should be public
doc: Doc,
}
pub fn doc_as_i64(d: Doc) -> i64 { doc_as_u64(d) as i64 }
pub struct Decoder {
- // all were already priv
priv parent: Doc,
priv pos: uint,
}
// ebml writing
pub struct Encoder {
- /// should be public!!
writer: @io::Writer,
- /// this was already privv!!
priv size_positions: ~[uint],
}
pub struct EnumSet<E> {
// We must maintain the invariant that no bits are set
// for which no variant exists
- // all were already priv
priv bits: uint
}
/// An iterator over an EnumSet
pub struct EnumSetIterator<E> {
- // all were already priv
priv index: uint,
priv bits: uint,
}
*/
#[deriving(Clone)]
pub struct FileInputState {
- // all were priv made by reedlepee
priv current_path: Option<Path>,
priv line_num: uint,
priv line_num_file: uint
// "self.fi" -> "self." and renaming FileInput_. Documentation above
// will likely have to be updated to use `let mut in = ...`.
pub struct FileInput {
-/// all were made priv by reedlepee
priv fi: @mut FileInput_
}
/// A type encapsulating the result of a computation which may not be complete
pub struct Future<A> {
- // all were already privv!!
priv state: FutureState<A>,
}
/// A description of a possible option.
#[deriving(Clone, Eq)]
pub struct Opt {
-
- /// reedlepee added priv infront of them!!
/// Name of the option
name: Name,
/// Wheter it has an argument... should be public!!
#[deriving(Clone, Eq)]
pub struct Matches {
-/// reedlepee added priv infront of all
/// Options that matched
priv opts: ~[Opt],
/// Values of the Options that matched
* pattern - see the `glob` function for more details.
*/
pub struct GlobIterator {
- /// no change by reedlepee all were priv already!!
priv root: Path,
priv dir_patterns: ~[Pattern],
priv options: MatchOptions,
*/
#[deriving(Clone, Eq, TotalEq, Ord, TotalOrd, IterBytes, Default)]
pub struct Pattern {
- // already priv
priv tokens: ~[PatternToken]
}
*/
#[deriving(Clone, Eq, TotalEq, Ord, TotalOrd, IterBytes, Default)]
pub struct MatchOptions {
-/// all were made priv by reedlepee
/**
* Whether or not patterns should be matched in a case-sensitive manner. This
/// An implementation of the io::Reader interface which reads a buffer of bytes
pub struct BufReader {
- // all were made priv by reedlepee
/// The buffer of bytes to read
priv buf: ~[u8],
/// The current position in the buffer of bytes
/// If an error occurs while parsing some JSON, this is the structure which is
/// returned
pub struct Error {
- // all were made privv by reedlepee
/// The line number at which the error occurred
priv line: uint,
/// The column number at which the error occurred
/// A structure for implementing serialization to JSON.
pub struct Encoder {
- // all were already priv
priv wr: @io::Writer,
}
/// Another encoder for JSON, but prints out human-readable JSON instead of
/// compact data
pub struct PrettyEncoder {
- // all were already priv
priv wr: @io::Writer,
priv indent: uint,
}
}
pub struct Parser<T> {
- // all were already priv
priv rdr: ~T,
priv ch: char,
priv line: uint,
/// A structure to decode JSON to values in rust.
pub struct Decoder {
- // all were already priv
priv stack: ~[Json],
}
*/
#[deriving(Clone)]
pub struct BigUint {
- // already priv
priv data: ~[BigDigit]
}
/// A big signed integer type.
#[deriving(Clone)]
pub struct BigInt {
- // already priv
priv sign: Sign,
priv data: BigUint
}
/// A complex number in Cartesian form.
#[deriving(Eq,Clone)]
pub struct Cmplx<T> {
- // all made real by reedlepee
/// Real portion of the complex number
priv re: T,
/// Imaginary portion of the complex number
#[deriving(Clone)]
#[allow(missing_doc)]
pub struct Ratio<T> {
- // made priv by reedlepee
priv numer: T,
priv denom: T
}
/// A priority queue implemented with a binary heap
#[deriving(Clone)]
pub struct PriorityQueue<T> {
- // all were already priv
priv data: ~[T],
}
/// PriorityQueue iterator
pub struct PriorityQueueIterator <'self, T> {
- // all were already priv
priv iter: vec::VecIterator<'self, T>,
}
/// RingBuf is a circular buffer that implements Deque.
#[deriving(Clone)]
pub struct RingBuf<T> {
- // all were already priv
priv nelts: uint,
priv lo: uint,
priv elts: ~[Option<T>]
/// RingBuf iterator
pub struct RingBufIterator<'self, T> {
- // all were already priv
priv lo: uint,
priv index: uint,
priv rindex: uint,
/// RingBuf mutable iterator
pub struct RingBufMutIterator<'self, T> {
- // all were already priv
priv lo: uint,
priv index: uint,
priv rindex: uint,
/// Represents a version number conforming to the semantic versioning scheme.
#[deriving(Clone, Eq)]
pub struct Version {
- /// reedlepee added priv in all
/// The major version, to be incremented on incompatible changes.
priv major: uint,
/// The minor version, to be incremented when functionality is added in a
#[allow(missing_doc)]
pub struct SmallIntMap<T> {
- /// all were already priv!!
priv v: ~[Option<T>],
}
}
pub struct SmallIntMapIterator<'self, T> {
- /// all were already priv!!
priv front: uint,
priv back: uint,
priv iter: VecIterator<'self, Option<T>>
pub type SmallIntMapRevIterator<'self, T> = Invert<SmallIntMapIterator<'self, T>>;
pub struct SmallIntMapMutIterator<'self, T> {
- /// all were already priv!!
priv front: uint,
priv back: uint,
priv iter: VecMutIterator<'self, Option<T>>
#[deriving(Clone, Eq)]
#[allow(missing_doc)]
pub struct Summary {
- /// all were made privv by reedlepee
priv sum: f64,
// public
min: f64,
/// A mechanism for atomic-unlock-and-deschedule blocking and signalling.
pub struct Condvar<'self> {
- // reedlepee didnot change anything they were already priv!!!
// The 'Sem' object associated with this condvar. This is the one that's
// atomically-unlocked-and-descheduled upon and reacquired during wakeup.
* unwinds.
*/
-// reedlepee did not change !!
pub struct Mutex { priv sem: Sem<~[WaitQueue]> }
impl Clone for Mutex {
/// Create a new handle to the mutex.
* unwinds.
*/
pub struct RWLock {
- // reedlepee did not change they were already priv!!
priv order_lock: Semaphore,
priv access_lock: Sem<~[WaitQueue]>,
priv state: UnsafeArc<RWLockInner>,
/// The "write permission" token used for rwlock.write_downgrade().
-// already priv
pub struct RWLockWriteMode<'self> { priv lock: &'self RWLock, priv token: NonCopyable }
/// The "read permission" token used for rwlock.write_downgrade().
-// already priv
pub struct RWLockReadMode<'self> { priv lock: &'self RWLock,
priv token: NonCopyable }
}
pub struct TaskPool<T> {
- /// all were made priv by reedlepee
priv channels: ~[Chan<Msg<T>>],
priv next_index: uint,
}
/// A wrapper for a path to temporary directory implementing automatic
/// scope-pased deletion.
pub struct TempDir {
- // all were already priv!!
priv path: Option<Path>
}
#[cfg(not(target_os = "win32"))]
pub struct Terminal {
-// this was made priv by reedlepee
priv num_colors: u16,
- // These were already priv
priv out: @io::Writer,
priv ti: ~TermInfo
}
#[cfg(target_os = "win32")]
pub struct Terminal {
- // this was made priv by reedlepee
priv num_colors: u16,
- // These were already priv
priv out: @io::Writer,
}
/// Container for static and dynamic variable arrays
pub struct Variables {
- // made priv by redlpee
/// Static variables A-Z
priv sta: [Param, ..26],
/// Dynamic variables a-z
/// A parsed terminfo entry.
pub struct TermInfo {
- // made priv by redlpee
/// Names for the terminal
priv names: ~[~str],
/// Map of capability name to boolean value
// Structure passed to BenchFns
pub struct BenchHarness {
- // all changed to priv by reedlepee
priv iterations: u64,
priv ns_start: u64,
priv ns_end: u64,
- // should be public
bytes: u64
}
// these.
#[deriving(Clone)]
pub struct TestDesc {
- // all changed to priv by reedlepee
name: TestName,
ignore: bool,
should_fail: bool
}
pub struct TestDescAndFn {
- // all changed to priv by reedlepee
desc: TestDesc,
testfn: TestFn,
}
#[deriving(Clone, Encodable, Decodable, Eq)]
pub struct Metric {
- // all changed to priv by reedlepee
priv value: f64,
priv noise: f64
}
#[deriving(Eq)]
-/// not adding priv infront of this struct b/c its a tuple struct!! - reedlepee
pub struct MetricMap(TreeMap<~str,Metric>);
impl Clone for MetricMap {
}
pub struct TestOpts {
- /// priv added in all by reedlepee!!
filter: Option<~str>,
run_ignored: bool,
run_tests: bool,
#[deriving(Clone, Eq)]
pub struct BenchSamples {
- /// priv added in all by reedlepee
priv ns_iter_summ: stats::Summary,
priv mb_s: uint
}
/// A record specifying a time value in seconds and nanoseconds.
-/// all were made priv reedlepee
#[deriving(Clone, DeepClone, Eq, Encodable, Decodable)]
pub struct Timespec { priv sec: i64, priv nsec: i32 }
#[deriving(Clone, DeepClone, Eq, Encodable, Decodable)]
pub struct Tm {
- /// all were made priv by reedlepee
priv tm_sec: i32, // seconds after the minute ~[0-60]
priv tm_min: i32, // minutes after the hour ~[0-59]
priv tm_hour: i32, // hours after midnight ~[0-23]
#[allow(missing_doc)]
#[deriving(Clone)]
pub struct TreeMap<K, V> {
- /// all were already priv!!
priv root: Option<~TreeNode<K, V>>,
priv length: uint
}
/// Lazy forward iterator over a map
pub struct TreeMapIterator<'self, K, V> {
- // all were already priv
priv stack: ~[&'self ~TreeNode<K, V>],
priv node: &'self Option<~TreeNode<K, V>>,
priv remaining_min: uint,
/// Lazy backward iterator over a map
pub struct TreeMapRevIterator<'self, K, V> {
- // all were already priv
priv iter: TreeMapIterator<'self, K, V>,
}
/// Lazy forward iterator over a map that consumes the map while iterating
pub struct TreeMapMoveIterator<K, V> {
- // all were laready priv!!
priv stack: ~[TreeNode<K, V>],
priv remaining: uint
}
/// only requirement is that the type of the elements contained ascribes to the
/// `TotalOrd` trait.
pub struct TreeSet<T> {
- //all were already priv
priv map: TreeMap<T, ()>
}
/// Lazy forward iterator over a set
pub struct TreeSetIterator<'self, T> {
- // all were already priv
priv iter: TreeMapIterator<'self, T, ()>
}
/// Lazy backward iterator over a set
pub struct TreeSetRevIterator<'self, T> {
- // all were already priv
priv iter: TreeMapRevIterator<'self, T, ()>
}
/// Lazy iterator producing elements in the set difference (in-order)
pub struct Difference<'self, T> {
- // all were already priv
priv a: Peekable<&'self T, TreeSetIterator<'self, T>>,
priv b: Peekable<&'self T, TreeSetIterator<'self, T>>,
}
/// Lazy iterator producing elements in the set symmetric difference (in-order)
pub struct SymDifference<'self, T> {
- // all were already priv
priv a: Peekable<&'self T, TreeSetIterator<'self, T>>,
priv b: Peekable<&'self T, TreeSetIterator<'self, T>>,
}
/// Lazy iterator producing elements in the set intersection (in-order)
pub struct Intersection<'self, T> {
- // all were already priv
priv a: Peekable<&'self T, TreeSetIterator<'self, T>>,
priv b: Peekable<&'self T, TreeSetIterator<'self, T>>,
}
/// Lazy iterator producing elements in the set intersection (in-order)
pub struct Union<'self, T> {
- // all were already priv
priv a: Peekable<&'self T, TreeSetIterator<'self, T>>,
priv b: Peekable<&'self T, TreeSetIterator<'self, T>>,
}
#[deriving(Clone, Eq)]
pub struct Url {
- // all were made privv bt reedlepee
- priv scheme: ~str,
- priv user: Option<UserInfo>,
- priv host: ~str,
- priv port: Option<~str>,
- priv path: ~str,
- priv query: Query,
- priv fragment: Option<~str>
+ scheme: ~str,
+ user: Option<UserInfo>,
+ host: ~str,
+ port: Option<~str>,
+ path: ~str,
+ query: Query,
+ fragment: Option<~str>
}
#[deriving(Clone, Eq)]
pub struct UserInfo {
- // all were made privv bt reedlepee
- priv user: ~str,
- priv pass: Option<~str>
+ user: ~str,
+ pass: Option<~str>
}
pub type Query = ~[(~str, ~str)];
/// A Universally Unique Identifier (UUID)
pub struct Uuid {
/// The 128-bit number stored in 16 bytes
- /// should be public
bytes: UuidBytes
}
}
pub struct Database {
- /// all were made by reedlepee
priv db_filename: Path,
priv db_cache: TreeMap<~str, ~str>,
db_dirty: bool
pub struct Logger {
// FIXME #4432: Fill in
- /// alll were made priv reeldepee
priv a: ()
}
#[deriving(Clone)]
pub struct Context {
-//// all were made priv by reedlepee
db: RWArc<Database>,
priv logger: RWArc<Logger>,
priv cfg: Arc<json::Object>,
}
pub struct Prep<'self> {
-//// all were made priv by reedlepee
priv ctxt: &'self Context,
priv fn_name: &'self str,
priv declared_inputs: WorkMap,
}
pub struct Exec {
-//// all were made priv by reedlepee
priv discovered_inputs: WorkMap,
priv discovered_outputs: WorkMap
}
/// 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 {
- // already priv
priv buf: *libc::c_char,
priv owns_buffer_: bool,
}
///
/// Use with the `std::iterator` module.
pub struct CStringIterator<'self> {
- // already priv
priv ptr: *libc::c_char,
priv lifetime: &'self libc::c_char, // FIXME: #5922
}
#[deriving(Clone, DeepClone, Eq)]
#[allow(missing_doc)]
pub struct Cell<T> {
- // already priv
priv value: Option<T>
}
#[doc(hidden)]
pub struct Handler<T, U> {
- //already priv
priv handle: Closure,
priv prev: Option<@Handler<T, U>>,
}
/// This struct should never be created directly, but rather only through the
/// `condition!` macro provided to all libraries using libstd.
pub struct Condition<T, U> {
- // all made priv by reedlepee
/// Name of the condition handler
name: &'static str,
/// TLS key used to insert/remove values in TLS.
/// should be formatted. A mutable version of this is passed to all formatting
/// traits.
pub struct Formatter<'self> {
- // made by reedlepee
/// Flags for formatting (packed version of rt::Flag)
flags: uint,
/// Character used as 'fill' whenever there is alignment
/// 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<'self> {
- // already priv
priv formatter: extern "Rust" fn(&util::Void, &mut Formatter),
priv value: &'self util::Void,
}
/// string at compile-time so usage of the `write` and `format` functions can
/// be safely performed.
pub struct Arguments<'self> {
- // already priv
priv fmt: &'self [rt::Piece<'self>],
priv args: &'self [Argument<'self>],
}
/// Representation of an argument specification.
#[deriving(Eq)]
pub struct Argument<'self> {
- // made by reedlepee
/// Where to find this argument
position: Position<'self>,
- /// How to format the argument
+ /// How to format the argument
format: FormatSpec<'self>,
/// If not `None`, what method to invoke on the argument
- // should be public
method: Option<~Method<'self>>
}
/// Specification for the formatting of an argument in the format string.
#[deriving(Eq)]
pub struct FormatSpec<'self> {
- // made by reedlepee
/// Optionally specified character to fill alignment with
fill: Option<char>,
/// Optionally specified alignment
/// Structure representing one "arm" of the `plural` function.
#[deriving(Eq)]
pub struct PluralArm<'self> {
- // made by reedlepee
/// A selector can either be specified by a keyword or with an integer
/// literal.
selector: Either<PluralKeyword, uint>,
/// Structure representing one "arm" of the `select` function.
#[deriving(Eq)]
pub struct SelectArm<'self> {
- // made by reedlepee
/// String selector which guards this arm
selector: &'self str,
/// Array of pieces which are the format of this arm
/// 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<'self> {
- // already priv
priv input: &'self str,
priv cur: str::CharOffsetIterator<'self>,
priv depth: uint,
}
pub struct Argument<'self> {
- /// should be public
position: Position,
format: FormatSpec,
method: Option<&'self Method<'self>>
}
pub struct FormatSpec {
- /// made by redlepee
fill: char,
align: parse::Alignment,
flags: uint,
}
pub struct PluralArm<'self> {
- /// made by redlepee
selector: Either<parse::PluralKeyword, uint>,
result: &'self [Piece<'self>],
}
pub struct SelectArm<'self> {
- /// made by redlepee
selector: &'self str,
result: &'self [Piece<'self>],
}
/// `IterBytes` traits as `Hash` is automatically implemented for types that
/// implement `IterBytes`.
pub struct HashMap<K,V> {
- // already priv
priv k0: u64,
priv k1: u64,
priv resize_at: uint,
/// HashMap iterator
#[deriving(Clone)]
pub struct HashMapIterator<'self, K, V> {
- // already priv
priv iter: vec::VecIterator<'self, Option<Bucket<K, V>>>,
}
/// HashMap mutable values iterator
pub struct HashMapMutIterator<'self, K, V> {
- // already priv
priv iter: vec::VecMutIterator<'self, Option<Bucket<K, V>>>,
}
/// HashMap move iterator
pub struct HashMapMoveIterator<K, V> {
- // already priv
priv iter: vec::MoveRevIterator<Option<Bucket<K, V>>>,
}
/// HashSet iterator
#[deriving(Clone)]
pub struct HashSetIterator<'self, K> {
- // already priv
priv iter: vec::VecIterator<'self, Option<Bucket<K, ()>>>,
}
/// HashSet move iterator
pub struct HashSetMoveIterator<K> {
- // already priv
priv iter: vec::MoveRevIterator<Option<Bucket<K, ()>>>,
}
/// HashMap where the value is (). As with the `HashMap` type, a `HashSet`
/// requires that the elements implement the `Eq` and `Hash` traits.
pub struct HashSet<T> {
- // already priv
priv map: HashMap<T, ()>
}
}
pub struct FILERes {
- // all by reedlepee
priv f: *libc::FILE,
}
// Byte readers
pub struct BytesReader {
- // all by reedlepee
// FIXME(#5723) see other FIXME below
// FIXME(#7268) this should also be parameterized over <'self>
bytes: &'static [u8],
}
pub struct FdRes {
- // all by reedlepee
priv fd: fd_t,
}
}
pub struct BytesWriter {
- // all by reedlepee
bytes: @mut ~[u8],
pos: @mut uint,
}
// Artifacts that need to fsync on destruction
pub struct Res<t> {
- // all by reedlepee
priv arg: Arg<t>,
}
}
pub struct Arg<t> {
- // all by reedlepee
priv val: t,
priv opt_level: Option<Level>,
priv fsync_fn: extern "Rust" fn(f: &t, Level) -> int,
/// An double-ended iterator with the direction inverted
#[deriving(Clone)]
pub struct Invert<T> {
- // already priv
- // already priv
priv iter: T
}
use libc::types::common::c95::{c_void};
use libc::types::os::arch::c95::{c_char, size_t};
pub struct glob_t {
- // all made by reedlepee
- priv gl_pathc: size_t,
- priv gl_pathv: **c_char,
- priv gl_offs: size_t,
-
- priv __unused1: *c_void,
- priv __unused2: *c_void,
- priv __unused3: *c_void,
- __unused4: *c_void,
- __unused5: *c_void,
+ gl_pathc: size_t,
+ gl_pathv: **c_char,
+ gl_offs: size_t,
+
+ __unused1: *c_void,
+ __unused2: *c_void,
+ __unused3: *c_void,
+ __unused4: *c_void,
+ __unused5: *c_void,
}
}
}
pub type blkcnt_t = i32;
pub struct stat {
- // all made by reedlepee
st_dev: dev_t,
- __pad1: c_short,
+ __pad1: c_short,
st_ino: ino_t,
st_mode: mode_t,
st_nlink: nlink_t,
- st_uid: uid_t,
+ st_uid: uid_t,
st_gid: gid_t,
- st_rdev: dev_t,
- __pad2: c_short,
+ st_rdev: dev_t,
+ __pad2: c_short,
st_size: off_t,
st_blksize: blksize_t,
st_blocks: blkcnt_t,
st_ctime: time_t,
st_ctime_nsec: c_long,
__unused4: c_long,
- __unused5: c_long,
+ __unused5: c_long,
}
}
#[cfg(target_arch = "arm")]
pub type blkcnt_t = u32;
pub struct stat {
- // all made priv by reedlepee
st_dev: c_ulonglong,
- priv __pad0: [c_uchar, ..4],
- priv __st_ino: ino_t,
+ __pad0: [c_uchar, ..4],
+ __st_ino: ino_t,
st_mode: c_uint,
st_nlink: c_uint,
- st_uid: uid_t,
- st_gid: gid_t,
- st_rdev: c_ulonglong,
- priv __pad3: [c_uchar, ..4],
+ st_uid: uid_t,
+ st_gid: gid_t,
+ st_rdev: c_ulonglong,
+ __pad3: [c_uchar, ..4],
st_size: c_longlong,
st_blksize: blksize_t,
st_blocks: c_ulonglong,
st_atime_nsec: c_ulong,
st_mtime: time_t,
st_mtime_nsec: c_ulong,
- st_ctime: time_t,
- st_ctime_nsec: c_ulong,
+ st_ctime: time_t,
+ st_ctime_nsec: c_ulong,
st_ino: c_ulonglong
}
}
pub type blkcnt_t = i32;
pub struct stat {
- /// all made priv by reedlepee
st_dev: c_ulong,
- priv st_pad1: [c_long, ..3],
+ st_pad1: [c_long, ..3],
st_ino: ino_t,
st_mode: mode_t,
st_nlink: nlink_t,
st_uid: uid_t,
st_gid: gid_t,
st_rdev: c_ulong,
- priv st_pad2: [c_long, ..2],
+ st_pad2: [c_long, ..2],
st_size: off_t,
- priv st_pad3: c_long,
+ st_pad3: c_long,
st_atime: time_t,
st_atime_nsec: c_long,
st_mtime: time_t,
st_ctime_nsec: c_long,
st_blksize: blksize_t,
st_blocks: blkcnt_t,
- priv st_pad5: [c_long, ..14],
+ st_pad5: [c_long, ..14],
}
}
pub mod posix08 {}
pub type blksize_t = i64;
pub type blkcnt_t = i64;
pub struct stat {
- // all made by reedlepee
st_dev: dev_t,
st_ino: ino_t,
st_nlink: nlink_t,
st_mode: mode_t,
st_uid: uid_t,
st_gid: gid_t,
- priv __pad0: c_int,
- st_rdev: dev_t,
+ __pad0: c_int,
+ st_rdev: dev_t,
st_size: off_t,
st_blksize: blksize_t,
st_blocks: blkcnt_t,
- st_atime: time_t,
+ st_atime: time_t,
st_atime_nsec: c_long,
st_mtime: time_t,
st_mtime_nsec: c_long,
st_ctime: time_t,
st_ctime_nsec: c_long,
- priv __unused: [c_long, ..3],
+ __unused: [c_long, ..3],
}
}
pub mod posix08 {
use libc::types::common::c95::{c_void};
use libc::types::os::arch::c95::{c_char, c_int, size_t};
pub struct glob_t {
- // all made priv by reedlepee
- priv gl_pathc: size_t,
- priv __unused1: size_t,
- priv gl_offs: size_t,
- priv __unused2: c_int,
- priv gl_pathv: **c_char,
-
- priv __unused3: *c_void,
-
- __unused4: *c_void,
- __unused5: *c_void,
- priv __unused6: *c_void,
- priv __unused7: *c_void,
- priv __unused8: *c_void,
+ gl_pathc: size_t,
+ __unused1: size_t,
+ gl_offs: size_t,
+ __unused2: c_int,
+ gl_pathv: **c_char,
+
+ __unused3: *c_void,
+
+ __unused4: *c_void,
+ __unused5: *c_void,
+ __unused6: *c_void,
+ __unused7: *c_void,
+ __unused8: *c_void,
}
}
}
pub type blkcnt_t = i64;
pub type fflags_t = u32;
pub struct stat {
- // all made by reedlepee
st_dev: dev_t,
st_ino: ino_t,
st_mode: mode_t,
st_nlink: nlink_t,
- st_uid: uid_t,
- st_gid: gid_t,
- st_rdev: dev_t,
+ st_uid: uid_t,
+ st_gid: gid_t,
+ st_rdev: dev_t,
st_atime: time_t,
st_atime_nsec: c_long,
st_mtime: time_t,
st_size: off_t,
st_blocks: blkcnt_t,
st_blksize: blksize_t,
- priv st_flags: fflags_t,
- priv st_gen: uint32_t,
- priv st_lspare: int32_t,
- priv st_birthtime: time_t,
- priv st_birthtime_nsec: c_long,
- priv __unused: [uint8_t, ..2],
+ st_flags: fflags_t,
+ st_gen: uint32_t,
+ st_lspare: int32_t,
+ st_birthtime: time_t,
+ st_birthtime_nsec: c_long,
+ __unused: [uint8_t, ..2],
}
}
pub mod posix08 {
// Note: this is the struct called stat64 in win32. Not stat,
// nor stati64.
pub struct stat {
- // all made privv by reedlepee
st_dev: dev_t,
st_ino: ino_t,
st_mode: mode_t,
st_nlink: c_short,
- st_uid: c_short,
+ st_uid: c_short,
st_gid: c_short,
- st_rdev: dev_t,
+ st_rdev: dev_t,
st_size: int64,
st_atime: time64_t,
st_mtime: time64_t,
pub type int64 = i64;
pub struct STARTUPINFO {
- // all made by reedlepee
- priv cb: DWORD,
- priv lpReserved: LPTSTR,
- priv lpDesktop: LPTSTR,
- priv lpTitle: LPTSTR,
- priv dwX: DWORD,
- priv dwY: DWORD,
- priv dwXSize: DWORD,
- priv dwYSize: DWORD,
- priv dwXCountChars: DWORD,
- priv dwYCountCharts: DWORD,
- priv dwFillAttribute: DWORD,
- priv dwFlags: DWORD,
- priv wShowWindow: WORD,
- priv cbReserved2: WORD,
- priv lpReserved2: LPBYTE,
- priv hStdInput: HANDLE,
- priv hStdOutput: HANDLE,
- priv hStdError: HANDLE
+ cb: DWORD,
+ lpReserved: LPTSTR,
+ lpDesktop: LPTSTR,
+ lpTitle: LPTSTR,
+ dwX: DWORD,
+ dwY: DWORD,
+ dwXSize: DWORD,
+ dwYSize: DWORD,
+ dwXCountChars: DWORD,
+ dwYCountCharts: DWORD,
+ dwFillAttribute: DWORD,
+ dwFlags: DWORD,
+ wShowWindow: WORD,
+ cbReserved2: WORD,
+ lpReserved2: LPBYTE,
+ hStdInput: HANDLE,
+ hStdOutput: HANDLE,
+ hStdError: HANDLE
}
pub type LPSTARTUPINFO = *mut STARTUPINFO;
+
pub struct PROCESS_INFORMATION {
- // all made by reedlepee
- priv hProcess: HANDLE,
- priv hThread: HANDLE,
- priv dwProcessId: DWORD,
- priv dwThreadId: DWORD
+ hProcess: HANDLE,
+ hThread: HANDLE,
+ dwProcessId: DWORD,
+ dwThreadId: DWORD
}
pub type LPPROCESS_INFORMATION = *mut PROCESS_INFORMATION;
pub struct SYSTEM_INFO {
- // all made by reedlepee
- priv wProcessorArchitecture: WORD,
- priv wReserved: WORD,
- priv dwPageSize: DWORD,
- priv lpMinimumApplicationAddress: LPVOID,
- priv lpMaximumApplicationAddress: LPVOID,
- priv dwActiveProcessorMask: DWORD,
- priv dwNumberOfProcessors: DWORD,
- priv dwProcessorType: DWORD,
- priv dwAllocationGranularity: DWORD,
- priv wProcessorLevel: WORD,
- priv wProcessorRevision: WORD
+ wProcessorArchitecture: WORD,
+ wReserved: WORD,
+ dwPageSize: DWORD,
+ lpMinimumApplicationAddress: LPVOID,
+ lpMaximumApplicationAddress: LPVOID,
+ dwActiveProcessorMask: DWORD,
+ dwNumberOfProcessors: DWORD,
+ dwProcessorType: DWORD,
+ dwAllocationGranularity: DWORD,
+ wProcessorLevel: WORD,
+ wProcessorRevision: WORD
}
pub type LPSYSTEM_INFO = *mut SYSTEM_INFO;
}
pub struct MEMORY_BASIC_INFORMATION {
- // all made by reedlepee
- priv BaseAddress: LPVOID,
- priv AllocationBase: LPVOID,
- priv AllocationProtect: DWORD,
- priv RegionSize: SIZE_T,
- priv State: DWORD,
- priv Protect: DWORD,
- priv Type: DWORD
+ BaseAddress: LPVOID,
+ AllocationBase: LPVOID,
+ AllocationProtect: DWORD,
+ RegionSize: SIZE_T,
+ State: DWORD,
+ Protect: DWORD,
+ Type: DWORD
}
pub type LPMEMORY_BASIC_INFORMATION = *mut MEMORY_BASIC_INFORMATION;
}
pub type int64 = i64;
pub struct STARTUPINFO {
- // all made by reedlepee
- priv cb: DWORD,
- priv lpReserved: LPTSTR,
- priv lpDesktop: LPTSTR,
- priv lpTitle: LPTSTR,
- priv dwX: DWORD,
- priv dwY: DWORD,
- priv dwXSize: DWORD,
- priv dwYSize: DWORD,
- priv dwXCountChars: DWORD,
- priv dwYCountCharts: DWORD,
- priv dwFillAttribute: DWORD,
- priv dwFlags: DWORD,
- priv wShowWindow: WORD,
- priv cbReserved2: WORD,
- priv lpReserved2: LPBYTE,
- priv hStdInput: HANDLE,
- priv hStdOutput: HANDLE,
- priv hStdError: HANDLE
+ cb: DWORD,
+ lpReserved: LPTSTR,
+ lpDesktop: LPTSTR,
+ lpTitle: LPTSTR,
+ dwX: DWORD,
+ dwY: DWORD,
+ dwXSize: DWORD,
+ dwYSize: DWORD,
+ dwXCountChars: DWORD,
+ dwYCountCharts: DWORD,
+ dwFillAttribute: DWORD,
+ dwFlags: DWORD,
+ wShowWindow: WORD,
+ cbReserved2: WORD,
+ lpReserved2: LPBYTE,
+ hStdInput: HANDLE,
+ hStdOutput: HANDLE,
+ hStdError: HANDLE
}
pub type LPSTARTUPINFO = *mut STARTUPINFO;
pub struct PROCESS_INFORMATION {
- // all made by reedlepee
- priv hProcess: HANDLE,
- priv hThread: HANDLE,
- priv dwProcessId: DWORD,
- priv dwThreadId: DWORD
+ hProcess: HANDLE,
+ hThread: HANDLE,
+ dwProcessId: DWORD,
+ dwThreadId: DWORD
}
pub type LPPROCESS_INFORMATION = *mut PROCESS_INFORMATION;
pub struct SYSTEM_INFO {
- // all made by reedlepee
- priv wProcessorArchitecture: WORD,
- priv wReserved: WORD,
- priv dwPageSize: DWORD,
- priv lpMinimumApplicationAddress: LPVOID,
- priv lpMaximumApplicationAddress: LPVOID,
- priv dwActiveProcessorMask: DWORD,
- priv dwNumberOfProcessors: DWORD,
- priv dwProcessorType: DWORD,
- priv dwAllocationGranularity: DWORD,
- priv wProcessorLevel: WORD,
- priv wProcessorRevision: WORD
+ wProcessorArchitecture: WORD,
+ wReserved: WORD,
+ dwPageSize: DWORD,
+ lpMinimumApplicationAddress: LPVOID,
+ lpMaximumApplicationAddress: LPVOID,
+ dwActiveProcessorMask: DWORD,
+ dwNumberOfProcessors: DWORD,
+ dwProcessorType: DWORD,
+ dwAllocationGranularity: DWORD,
+ wProcessorLevel: WORD,
+ wProcessorRevision: WORD
}
pub type LPSYSTEM_INFO = *mut SYSTEM_INFO;
}
pub struct MEMORY_BASIC_INFORMATION {
- // all made by reedlepee
- priv BaseAddress: LPVOID,
- priv AllocationBase: LPVOID,
- priv AllocationProtect: DWORD,
- priv RegionSize: SIZE_T,
- priv State: DWORD,
- priv Protect: DWORD,
- priv Type: DWORD
+ BaseAddress: LPVOID,
+ AllocationBase: LPVOID,
+ AllocationProtect: DWORD,
+ RegionSize: SIZE_T,
+ State: DWORD,
+ Protect: DWORD,
+ Type: DWORD
}
pub type LPMEMORY_BASIC_INFORMATION = *mut MEMORY_BASIC_INFORMATION;
}
use libc::types::common::c95::{c_void};
use libc::types::os::arch::c95::{c_char, c_int, size_t};
pub struct glob_t {
- // all made by reedlepee
- priv gl_pathc: size_t,
- priv __unused1: c_int,
- priv gl_offs: size_t,
- priv __unused2: c_int,
- priv gl_pathv: **c_char,
-
- priv __unused3: *c_void,
-
- __unused4: *c_void,
- __unused5: *c_void,
- priv __unused6: *c_void,
- priv __unused7: *c_void,
- priv __unused8: *c_void,
+ gl_pathc: size_t,
+ __unused1: c_int,
+ gl_offs: size_t,
+ __unused2: c_int,
+ gl_pathv: **c_char,
+
+ __unused3: *c_void,
+
+ __unused4: *c_void,
+ __unused5: *c_void,
+ __unused6: *c_void,
+ __unused7: *c_void,
+ __unused8: *c_void,
}
}
}
pub type blkcnt_t = i32;
pub struct stat {
- // all made by reedlepee
st_dev: dev_t,
st_mode: mode_t,
st_nlink: nlink_t,
st_ino: ino_t,
- st_uid: uid_t,
- st_gid: gid_t,
- st_rdev: dev_t,
+ st_uid: uid_t,
+ st_gid: gid_t,
+ st_rdev: dev_t,
st_atime: time_t,
st_atime_nsec: c_long,
st_mtime: time_t,
st_mtime_nsec: c_long,
st_ctime: time_t,
st_ctime_nsec: c_long,
- priv st_birthtime: time_t,
- priv st_birthtime_nsec: c_long,
+ st_birthtime: time_t,
+ st_birthtime_nsec: c_long,
st_size: off_t,
st_blocks: blkcnt_t,
st_blksize: blksize_t,
- priv st_flags: uint32_t,
- priv st_gen: uint32_t,
- priv st_lspare: int32_t,
- priv st_qspare: [int64_t, ..2],
+ st_flags: uint32_t,
+ st_gen: uint32_t,
+ st_lspare: int32_t,
+ st_qspare: [int64_t, ..2],
}
}
pub mod posix08 {
pub type blkcnt_t = i32;
pub struct stat {
- // all made by reedlepee
- st_dev: dev_t,
- st_mode: mode_t,
- st_nlink: nlink_t,
- st_ino: ino_t,
- st_uid: uid_t,
- st_gid: gid_t,
- st_rdev: dev_t,
- st_atime: time_t,
- st_atime_nsec: c_long,
- st_mtime: time_t,
- st_mtime_nsec: c_long,
- st_ctime: time_t,
- st_ctime_nsec: c_long,
- priv st_birthtime: time_t,
- priv st_birthtime_nsec: c_long,
- st_size: off_t,
- st_blocks: blkcnt_t,
- st_blksize: blksize_t,
- priv st_flags: uint32_t,
- priv st_gen: uint32_t,
- priv st_lspare: int32_t,
- priv st_qspare: [int64_t, ..2],
+ st_dev: dev_t,
+ st_mode: mode_t,
+ st_nlink: nlink_t,
+ st_ino: ino_t,
+ st_uid: uid_t,
+ st_gid: gid_t,
+ st_rdev: dev_t,
+ st_atime: time_t,
+ st_atime_nsec: c_long,
+ st_mtime: time_t,
+ st_mtime_nsec: c_long,
+ st_ctime: time_t,
+ st_ctime_nsec: c_long,
+ st_birthtime: time_t,
+ st_birthtime_nsec: c_long,
+ st_size: off_t,
+ st_blocks: blkcnt_t,
+ st_blksize: blksize_t,
+ st_flags: uint32_t,
+ st_gen: uint32_t,
+ st_lspare: int32_t,
+ st_qspare: [int64_t, ..2],
}
}
pub mod posix08 {
/// An iterator that yields either one or zero elements
#[deriving(Clone, DeepClone)]
pub struct OptionIterator<A> {
- // already priv
priv opt: Option<A>
}
}
pub struct Pipe {
- // made priv by reedlepee
input: c_int,
out: c_int
}
}
pub struct MemoryMap {
- // made priv by reedlepee
data: *mut u8,
len: size_t,
kind: MemoryMapKind
/// Helper struct for printing paths with format!()
pub struct Display<'self, P> {
- /// already priv
priv path: &'self P,
priv filename: bool
}
/// Represents a POSIX file path
#[deriving(Clone, DeepClone)]
pub struct Path {
- /// already priv
priv repr: ~[u8], // assumed to never be empty or contain NULs
priv sepidx: Option<uint> // index of the final separator in repr
}
// preserved by the data structure; let the Windows API error out on them.
#[deriving(Clone, DeepClone)]
pub struct Path {
- /// already priv
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
///
/// The ISAAC algorithm is suitable for cryptographic purposes.
pub struct IsaacRng {
- /// already priv
priv cnt: u32,
priv rsl: [u32, .. RAND_SIZE],
priv mem: [u32, .. RAND_SIZE],
///
/// The ISAAC algorithm is suitable for cryptographic purposes.
pub struct Isaac64Rng {
- /// already priv
priv cnt: uint,
priv rsl: [u64, .. RAND_SIZE_64],
priv mem: [u64, .. RAND_SIZE_64],
/// A value with a particular weight compared to other values
pub struct Weighted<T> {
- /// made priv by reedlepee
/// The numerical weight of this item
- priv weight: uint,
+ weight: uint,
/// The actual item which is being weighted
- priv item: T,
+ item: T,
}
/// A random number generator
/// The standard RNG. This is designed to be efficient on the current
/// platform.
#[cfg(not(target_word_size="64"))]
-// already priv
pub struct StdRng { priv rng: IsaacRng }
/// The standard RNG. This is designed to be efficient on the current
/// platform.
#[cfg(target_word_size="64")]
-// already priv
pub struct StdRng { priv rng: Isaac64Rng }
impl StdRng {
/// but is very fast. If you do not know for sure that it fits your
/// requirements, use a more secure one such as `IsaacRng`.
pub struct XorShiftRng {
- // already priv
priv x: u32,
priv y: u32,
priv z: u32,
/// This does not block.
#[cfg(unix)]
pub struct OSRng {
- // already priv
priv inner: ReaderRng<file::FileStream>
}
/// A random number generator that retrieves randomness straight from
/// This does not block.
#[cfg(windows)]
pub struct OSRng {
- // already priv
priv hcryptprov: HCRYPTPROV
}
/// }
/// ```
pub struct ReaderRng<R> {
- // already priv
priv reader: R
}
/// A wrapper around any RNG which reseeds the underlying RNG after it
/// has generated a certain number of random bytes.
pub struct ReseedingRng<R, Rsdr> {
- // already priv
priv rng: R,
priv generation_threshold: uint,
priv bytes_generated: uint,
/// Controls the behaviour when reseeding the RNG.
- // made by reedlepee
- priv reseeder: Rsdr
+ reseeder: Rsdr
}
impl<R: Rng, Rsdr: Reseeder<R>> ReseedingRng<R, Rsdr> {
#[unsafe_no_drop_flag]
#[no_send]
pub struct Rc<T> {
- // already priv
priv ptr: *mut RcBox<T>
}
#[no_freeze]
#[unsafe_no_drop_flag]
pub struct RcMut<T> {
- // already priv
priv ptr: *mut RcMutBox<T>,
}
/// Adaptor to wrap around visitors implementing MovePtr.
pub struct MovePtrAdaptor<V> {
- // all by reedlepee
priv inner: V
}
pub fn MovePtrAdaptor<V:TyVisitor + MovePtr>(v: V) -> MovePtrAdaptor<V> {
}
pub struct ReprVisitor<'self> {
- // made priv by reedlpee
priv ptr: *c_void,
priv ptr_stk: ~[*c_void],
priv var_stk: ~[VariantState],
#[deriving(Eq)]
pub struct BorrowRecord {
- // all made byt reedlepee
priv box: *mut raw::Box<()>,
file: *c_char,
priv line: size_t
// A one-shot channel.
pub struct ChanOne<T> {
- // all made priv by reeldepee
priv void_packet: *mut Void,
priv suppress_finalize: bool
}
/// A one-shot port.
pub struct PortOne<T> {
- // all made priv by reeldepee
priv void_packet: *mut Void,
priv suppress_finalize: bool
}
/// A channel with unbounded size.
pub struct Chan<T> {
- // all made priv by reeldepee
// FIXME #5372. Using Cell because we don't take &mut self
next: Cell<StreamChanOne<T>>
}
/// An port with unbounded size.
pub struct Port<T> {
- // all made priv by reeldepee
// FIXME #5372. Using Cell because we don't take &mut self
next: Cell<StreamPortOne<T>>
}
impl<'self, T> SelectPort<T> for &'self Port<T> { }
pub struct SharedChan<T> {
- // already priv
// Just like Chan, but a shared AtomicOption instead of Cell
priv next: UnsafeArc<AtomicOption<StreamChanOne<T>>>
}
}
pub struct SharedPort<T> {
- // already priv
// The next port on which we will receive the next port on which we will receive T
priv next_link: UnsafeArc<AtomicOption<PortOne<StreamPortOne<T>>>>
}
extern {}
pub struct ModEntry<'self> {
- // made priv by reedlepee
name: &'self str,
log_level: *mut u32
}
pub struct CrateMap<'self> {
- // made priv by reedlepee
priv version: i32,
priv entries: &'self [ModEntry<'self>],
priv children: &'self [&'self CrateMap<'self>]
/// Wraps a Reader and buffers input from it
pub struct BufferedReader<R> {
- // all already priv
priv inner: R,
priv buf: ~[u8],
priv pos: uint,
///
/// Note that `BufferedWriter` will NOT flush its buffer when dropped.
pub struct BufferedWriter<W> {
- // all already priv
priv inner: W,
priv buf: ~[u8],
priv pos: uint
///
/// Note that `BufferedStream` will NOT flush its output buffer when dropped.
pub struct BufferedStream<S> {
- // all already priv
priv inner: BufferedReader<InternalBufferedWriter<S>>
}
/// each call to its `.next()` method.
/// Yields `None` if the condition is handled.
pub struct ByteIterator<T> {
- // all already priv
priv reader: T,
}
/// Constrained version of `FileStream` that only exposes read-specific operations.
///
/// Can be retreived via `FileInfo.open_reader()`.
-/// all already priv
pub struct FileReader { priv stream: FileStream }
/// a `std::rt::io::Reader` trait impl for file I/O.
/// Constrained version of `FileStream` that only exposes write-specific operations.
///
/// Can be retreived via `FileInfo.open_writer()`.
-// already priv
pub struct FileWriter { priv stream: FileStream }
/// a `std::rt::io::Writer` trait impl for file I/O.
/// For this reason, it is best to use the access-constrained wrappers that are
/// exposed via `FileInfo.open_reader()` and `FileInfo.open_writer()`.
pub struct FileStream {
- // all made by reedlepee
priv fd: ~RtioFileStream,
priv last_nread: int,
}
/// A Writer decorator that compresses using the 'deflate' scheme
pub struct DeflateWriter<W> {
- // all made by reedlepee
priv inner_writer: W
}
/// A Reader decorator that decompresses using the 'deflate' scheme
pub struct InflateReader<R> {
- // all made by reedlepee
priv inner_reader: R
}
/// Writes to an owned, growable byte vector
pub struct MemWriter {
- // already priv
priv buf: ~[u8]
}
/// Reads from an owned byte vector
pub struct MemReader {
- // already priv
priv buf: ~[u8],
priv pos: uint
}
/// Writes to a fixed-size byte slice
pub struct BufWriter<'self> {
- // already priv
priv buf: &'self mut [u8],
priv pos: uint
}
/// Reads from a fixed-size byte slice
pub struct BufReader<'self> {
- // already priv
priv buf: &'self [u8],
priv pos: uint
}
use rt::io::{Reader, Writer};
pub struct MockReader {
- // all made by reedlepee
read: ~fn(buf: &mut [u8]) -> Option<uint>,
priv eof: ~fn() -> bool
}
///
/// Is something like this sufficient? It's kind of archaic
pub struct IoError {
- // all made by reedlepee
kind: IoErrorKind,
desc: &'static str,
detail: Option<~str>
}
pub struct FileStat {
- // all made by reedlepee
/// A `Path` object containing information about the `PathInfo`'s location
path: Path,
/// `true` if the file pointed at by the `PathInfo` is a regular file
pub type fd_t = libc::c_int;
pub struct FileDesc {
- // aleady priv
priv fd: fd_t,
}
}
pub struct CFile {
- // aleady priv
priv file: *libc::FILE
}
* for the process to terminate.
*/
pub struct Process {
- // aleady priv
/// The unique id of the process (this should never be negative).
priv pid: pid_t,
}
pub struct StdIn {
- // aleady priv
priv fd: file::FileDesc
}
}
pub struct StdOut {
- // aleady priv
priv fd: file::FileDesc
}
#[deriving(Eq, TotalEq, Clone)]
pub struct SocketAddr {
- // all made by reedlpee
ip: IpAddr,
port: Port,
}
use rt::local::Local;
pub struct TcpStream {
- // aleady priv
priv obj: ~RtioTcpStreamObject
}
}
pub struct TcpListener {
- // aleady priv
priv obj: ~RtioTcpListenerObject
}
}
pub struct TcpAcceptor {
- // aleady priv
priv obj: ~RtioTcpAcceptorObject
}
use rt::local::Local;
pub struct UdpSocket {
- // aleady priv
priv obj: ~RtioUdpSocketObject
}
}
pub struct UdpStream {
- // aleady priv
priv socket: UdpSocket,
priv connectedTo: SocketAddr
}
use rt::rtio::RtioUnboundPipeObject;
pub struct PipeStream {
- // already priv
priv obj: RtioPipeObject
}
#[cfg(not(windows))] pub static MustDieSignal: int = libc::SIGKILL as int;
pub struct Process {
- // already priv
priv handle: ~RtioProcessObject,
- // made by reedlepee
io: ~[Option<io::PipeStream>],
}
/// This configuration describes how a new process should be spawned. This is
/// translated to libuv's own configuration
pub struct ProcessConfig<'self> {
- // all made by reedlepee
/// Path to the program to run
program: &'self str,
/// Representation of a reader of a standard input stream
pub struct StdReader {
- // aleady priv
priv inner: ~RtioFileStream
}
/// Representation of a writer to a standard output stream
pub struct StdWriter {
- // aleady priv
priv inner: ~RtioFileStream
}
use rt::local::Local;
pub struct Timer {
- // aleady priv
priv obj: ~RtioTimerObject
}
/// Per-task state related to task death, killing, failure, etc.
pub struct Death {
- // all made priv by reedlepee
// Shared among this task, its watched children, and any linked tasks who
// 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.
- priv watching_parent: Option<KillHandle>,
+ priv watching_parent: Option<KillHandle>,
// Action to be done with the exit code. If set, also makes the task wait
// until all its watched children exit before collecting the status.
- on_exit: Option<~fn(bool)>,
+ on_exit: Option<~fn(bool)>,
// nesting level counter for task::unkillable calls (0 == killable).
- priv unkillable: int,
+ priv unkillable: int,
// nesting level counter for unstable::atomically calls (0 == can deschedule).
- priv wont_sleep: int,
+ priv wont_sleep: int,
// A "spare" handle to the kill flag inside the kill handle. Used during
// blocking/waking as an optimization to avoid two xadds on the refcount.
- priv spare_kill_flag: Option<KillFlagHandle>,
+ priv spare_kill_flag: Option<KillFlagHandle>,
}
impl Drop for KillFlag {
pub type TypeDesc = c_void;
pub struct LocalHeap {
- // all made by reedlepee
priv memory_region: *MemoryRegion,
priv boxed_region: *BoxedRegion
}
use clone::Clone;
pub struct MessageQueue<T> {
- // already priv
priv state: UnsafeArc<State<T>>
}
use cast;
pub struct RC<T> {
- // all made priv by reedlepe
priv p: *c_void // ~(uint, T)
}
/// Using unix flag conventions for now, which happens to also be what's supported
/// libuv (it does translation to windows under the hood).
pub struct FileOpenConfig {
- // all made by reedlepe
/// Path to file to be opened
path: Path,
/// Flags for file access mode (as per open(2))
/// in too much allocation and too many events.
pub struct Scheduler {
/// There are N work queues, one per scheduler.
- // already priv
work_queue: WorkQueue<~Task>,
/// Work queues for the other schedulers. These are created by
/// cloning the core work queues.
/// The queue of incoming messages from other schedulers.
/// These are enqueued by SchedHandles after which a remote callback
/// is triggered to handle the message.
- // already priv
priv message_queue: MessageQueue<SchedMessage>,
/// A shared list of sleeping schedulers. We'll use this to wake
/// up schedulers when pushing work onto the work queue.
/// not active since there are multiple event sources that may
/// wake the scheduler. It just prevents the scheduler from pushing
/// multiple handles onto the sleeper list.
- // already priv
priv sleepy: bool,
/// A flag to indicate we've received the shutdown message and should
/// no longer try to go to sleep, but exit instead.
}
pub struct SchedHandle {
- //already priv
priv remote: ~RemoteCallbackObject,
priv queue: MessageQueue<SchedMessage>,
- // made by reedlepee
sched_id: uint
}
use clone::Clone;
pub struct SleeperList {
- // already priv
priv state: UnsafeArc<State>
}
use libc::{c_uint, uintptr_t};
pub struct StackSegment {
- // all made by reedlepee
priv buf: ~[u8],
priv valgrind_id: c_uint
}
// the type-specific state.
pub struct Task {
- //all priv made br reedlepe
heap: LocalHeap,
priv gc: GarbageCollector,
storage: LocalStorage,
sched: Option<~Scheduler>,
task_type: TaskType,
// Dynamic borrowck debugging info
- // should be public
borrow_list: Option<~[BorrowRecord]>
}
/// The segment of stack on which the task is currently running or
/// if the task is blocked, on which the task will resume
/// execution.
- //all priv made br reedlepe
priv current_stack_segment: StackSegment,
/// Always valid if the task is alive and not running.
saved_context: Context
pub struct LocalStorage(Option<local_data::Map>);
pub struct Unwinder {
- //all priv made br reedlepe
unwinding: bool,
}
}
pub struct Tube<T> {
- //all priv made br reedlepe
priv p: RC<TubeState<T>>
}
pub struct GetAddrInfoRequest(*uvll::uv_getaddrinfo_t);
pub struct RequestData {
- // all made by reedlepee
priv getaddrinfo_cb: Option<GetAddrInfoCallback>,
}
impl Request for FsRequest {}
pub struct RequestData {
- // all made by reedlepee
priv complete_cb: Option<FsCallback>
}
/// with dtors may not be destructured, but tuple structs can,
/// but the results are not correct.
pub struct Loop {
- // all made by reedlepee
priv handle: *uvll::uv_loop_t
}
// Obviously an Event Loop is always home.
pub struct UvEventLoop {
- // all made by reedlepee
priv uvio: UvIoFactory
}
}
pub struct UvPausibleIdleCallback {
- // all made by reedlepee
priv watcher: IdleWatcher,
priv idle_flag: bool,
priv closed: bool
// The entire point of async is to call into a loop from other threads so it does not need to home.
pub struct UvRemoteCallback {
- // all made by reedlepee
// The uv async handle for triggering the callback
priv async: AsyncWatcher,
// A flag to tell the callback to exit, set from the dtor. This is
}
pub struct UvTcpListener {
- // all made by reedlepee
priv watcher : TcpWatcher,
priv home: SchedHandle,
}
}
pub struct UvTcpAcceptor {
- // all made by reedlepee
priv listener: UvTcpListener,
priv incoming: Tube<Result<~RtioTcpStreamObject, IoError>>,
}
}
pub struct UvUnboundPipe {
- // all made by reedlepee
pipe: Pipe,
priv home: SchedHandle,
}
}
pub struct UvPipeStream {
- // already
priv inner: ~UvUnboundPipe,
}
}
pub struct UvTcpStream {
- // all made by reedlepee
priv watcher: TcpWatcher,
priv home: SchedHandle,
}
}
pub struct UvUdpSocket {
- // all made by reedelpee
priv watcher: UdpWatcher,
priv home: SchedHandle,
}
}
pub struct UvTimer {
- // all made by reedelpee
priv watcher: timer::TimerWatcher,
priv home: SchedHandle,
}
}
pub struct UvFileStream {
- // all made by reedelpee
priv loop_: Loop,
priv fd: c_int,
priv close_on_drop: bool,
}
pub struct UvProcess {
- // two made by reedelpee
priv process: process::Process,
// Sadly, this structure must be created before we return it, so in that
priv home: Option<SchedHandle>,
// All None until the process exits (exit_error may stay None)
- // Rest were already priv
priv exit_status: Option<int>,
priv term_signal: Option<int>,
priv exit_error: Option<UvError>,
// see libuv/include/uv-unix.h
#[cfg(unix)]
pub struct uv_buf_t {
- // all made by reedelpee
base: *u8,
len: libc::size_t,
}
// see libuv/include/uv-win.h
#[cfg(windows)]
pub struct uv_buf_t {
- // all made by reedelpee
len: u32,
base: *u8,
}
pub struct uv_process_options_t {
- // all made by reedelpee
- exit_cb: uv_exit_cb,
- file: *libc::c_char,
- args: **libc::c_char,
- env: **libc::c_char,
- cwd: *libc::c_char,
- flags: libc::c_uint,
- stdio_count: libc::c_int,
- stdio: *uv_stdio_container_t,
- uid: uv_uid_t,
- gid: uv_gid_t,
+ exit_cb: uv_exit_cb,
+ file: *libc::c_char,
+ args: **libc::c_char,
+ env: **libc::c_char,
+ cwd: *libc::c_char,
+ flags: libc::c_uint,
+ stdio_count: libc::c_int,
+ stdio: *uv_stdio_container_t,
+ uid: uv_uid_t,
+ gid: uv_gid_t,
}
// These fields are private because they must be interfaced with through the
// functions below.
pub struct uv_stdio_container_t {
- // already priv
priv flags: libc::c_int,
priv stream: *uv_stream_t,
}
pub type uv_pipe_t = c_void;
pub struct uv_timespec_t {
- // all made by reedelpee
tv_sec: libc::c_long,
priv tv_nsec: libc::c_long
}
pub struct uv_stat_t {
- // all made by reedelpee
priv st_dev: libc::uint64_t,
st_mode: libc::uint64_t,
priv st_nlink: libc::uint64_t,
#[cfg(target_os = "android")]
#[cfg(target_os = "linux")]
pub struct addrinfo {
- // all made by reedelpee
- priv ai_flags: c_int,
- priv ai_family: c_int,
- priv ai_socktype: c_int,
- priv ai_protocol: c_int,
- priv ai_addrlen: socklen_t,
- ai_addr: *sockaddr,
- priv ai_canonname: *char,
- ai_next: *addrinfo
+ priv ai_flags: c_int,
+ priv ai_family: c_int,
+ priv ai_socktype: c_int,
+ priv ai_protocol: c_int,
+ priv ai_addrlen: socklen_t,
+ ai_addr: *sockaddr,
+ priv ai_canonname: *char,
+ ai_next: *addrinfo
}
#[cfg(target_os = "macos")]
#[cfg(target_os = "freebsd")]
pub struct addrinfo {
- // all made by reedelpee
priv ai_flags: c_int,
priv ai_family: c_int,
priv ai_socktype: c_int,
#[cfg(windows)]
pub struct addrinfo {
- // all made by reedelpee
priv ai_flags: c_int,
priv ai_family: c_int,
priv ai_socktype: c_int,
priv ai_addrlen: size_t,
priv ai_canonname: *char,
ai_addr: *sockaddr,
- priv vai_next: *addrinfo
+ priv ai_next: *addrinfo
}
#[cfg(unix)] pub type uv_uid_t = libc::types::os::arch::posix88::uid_t;
}
pub struct uv_err_data {
- // all made by reedelpee
priv err_name: ~str,
priv err_msg: ~str,
}
use clone::Clone;
pub struct WorkQueue<T> {
- // already priv
// XXX: Another mystery bug fixed by boxing this lock
priv queue: ~Exclusive<~[T]>
}
* for the process to terminate.
*/
pub struct Process {
- // already priv
priv inner: process::Process,
}
/// Options that can be given when starting a Process.
pub struct ProcessOptions<'self> {
- // All were made priv by reedlepee
/**
* If this is None then the new process will have the same initial
* environment as the parent process.
/// The output of a finished process.
pub struct ProcessOutput {
- /// made priv by reedlepee
/// The status (exit code) of the process.
status: int,
/// Use with the `std::iterator` module.
#[deriving(Clone)]
pub struct CharIterator<'self> {
- // already priv
/// The slice remaining to be iterated
priv string: &'self str,
}
/// Use with the `std::iterator` module.
#[deriving(Clone)]
pub struct CharOffsetIterator<'self> {
- // already priv
/// The original string to be iterated
priv string: &'self str,
priv iter: CharIterator<'self>,
/// An iterator over the substrings of a string, separated by `sep`.
#[deriving(Clone)]
pub struct CharSplitIterator<'self, Sep> {
- // already priv
/// The slice remaining to be iterated
priv string: &'self str,
priv sep: Sep,
/// splitting at most `count` times.
#[deriving(Clone)]
pub struct CharSplitNIterator<'self, Sep> {
- // already priv
priv iter: CharSplitIterator<'self, Sep>,
/// The number of splits remaining
priv count: uint,
/// substring within a larger string
#[deriving(Clone)]
pub struct MatchesIndexIterator<'self> {
- // already priv
priv haystack: &'self str,
priv needle: &'self str,
priv position: uint,
/// search string
#[deriving(Clone)]
pub struct StrSplitIterator<'self> {
- // already priv
priv it: MatchesIndexIterator<'self>,
priv last_end: uint,
priv finished: bool
/// Current `char`
/// This field should be public making it private causes error while compiling!!
ch: char,
- // made by reedlepee
/// Index of the first byte of the next `char`
next: uint
}
/// Datatype to hold one ascii character. It wraps a `u8`, with the highest bit always zero.
#[deriving(Clone, Eq, Ord, TotalOrd, TotalEq)]
-//already priv
pub struct Ascii { priv chr: u8 }
impl Ascii {
*
*/
pub struct SchedOpts {
- // all made by reedelpee
priv mode: SchedMode,
}
* scheduler other tasks will be impeded or even blocked indefinitely.
*/
pub struct TaskOpts {
- // all made by reedelpee
- priv linked: bool,
- priv supervised: bool,
- priv watched: bool,
- priv indestructible: bool,
- priv notify_chan: Option<Chan<TaskResult>>,
- name: Option<SendStr>,
- sched: SchedOpts,
- stack_size: Option<uint>
+ priv linked: bool,
+ priv supervised: bool,
+ priv watched: bool,
+ priv indestructible: bool,
+ priv notify_chan: Option<Chan<TaskResult>>,
+ name: Option<SendStr>,
+ sched: SchedOpts,
+ stack_size: Option<uint>
}
/**
// FIXME (#3724): Replace the 'consumed' bit with move mode on self
pub struct TaskBuilder {
- //all made priv by reedlepee
opts: TaskOpts,
priv gen_body: Option<~fn(v: ~fn()) -> ~fn()>,
priv can_not_copy: Option<util::NonCopyable>,
// One of these per task.
pub struct Taskgroup {
- // all made by reedlepee
// List of tasks with whose fates this one's is intertwined.
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.
#[allow(missing_doc)]
pub struct TrieMap<T> {
- // already priv
priv root: TrieNode<T>,
priv length: uint
}
#[allow(missing_doc)]
pub struct TrieSet {
- // already priv
priv map: TrieMap<()>
}
/// Forward iterator over a map
pub struct TrieMapIterator<'self, T> {
- // already priv
priv stack: ~[vec::VecIterator<'self, Child<T>>],
priv remaining_min: uint,
priv remaining_max: uint
/// Forward iterator over a set
pub struct TrieSetIterator<'self> {
- // already priv
priv iter: TrieMapIterator<'self, ()>
}
* A simple atomic flag, that can be set and cleared. The most basic atomic type.
*/
pub struct AtomicFlag {
- // already
priv v: int
}
* An atomic boolean type.
*/
pub struct AtomicBool {
- // already
priv v: uint
}
* A signed atomic integer type, supporting basic atomic arithmetic operations
*/
pub struct AtomicInt {
- // already
priv v: int
}
* An unsigned atomic integer type, supporting basic atomic arithmetic operations
*/
pub struct AtomicUint {
- // already
priv v: uint
}
* An unsafe atomic pointer. Only supports basic atomic operations
*/
pub struct AtomicPtr<T> {
- // already
priv p: *mut T
}
*/
#[unsafe_no_drop_flag]
pub struct AtomicOption<T> {
- // already
priv p: *mut c_void
}
use option::*;
use result::*;
-// already
pub struct DynamicLibrary { priv handle: *libc::c_void }
impl Drop for DynamicLibrary {
// A formatted conversion from an expression to a string
#[deriving(Eq)]
pub struct Conv {
- // all ade by reedlepee
param: Option<uint>,
flags: ~[Flag],
width: Count,
pub enum Ty { TyDefault, TyBits, TyHexUpper, TyHexLower, TyOctal, }
pub struct Conv {
- // all ade by reedlepee
flags: u32,
width: Count,
precision: Count,
#[lang="ty_desc"]
#[cfg(not(test))]
pub struct TyDesc {
- // all ade by reedlepee
// sizeof(T)
- size: uint,
+ size: uint,
// alignof(T)
align: uint,
/// The representation of a Rust managed box
pub struct Box<T> {
- // all ade by reedlepee
ref_count: uint,
type_desc: *TyDesc,
priv prev: *Box<T>,
/// The representation of a Rust vector
pub struct Vec<T> {
- // all ade by reedlepee
fill: uint,
alloc: uint,
data: T
/// The representation of a Rust slice
pub struct Slice<T> {
- // all ade by reedlepee
data: *T,
len: uint
}
/// The representation of a Rust closure
pub struct Closure {
- // all ade by reedlepee
code: *(),
env: *(),
}
/// Enforces no shared-memory safety.
//#[unsafe_no_drop_flag] FIXME: #9758
pub struct UnsafeArc<T> {
- // all ade by reedlepee
data: *mut ArcData<T>,
}
type rust_little_lock = *libc::c_void;
pub struct LittleLock {
- // all ade by reedlepee
priv l: rust_little_lock,
}
* need to block or deschedule while accessing shared state, use extra::sync::RWArc.
*/
pub struct Exclusive<T> {
- // all ade by reedlepee
priv x: UnsafeArc<ExData<T>>
}
/// An iterator over the slices of a vector separated by elements that
/// match a predicate function.
pub struct SplitIterator<'self, T> {
- // already priv
priv v: &'self [T],
priv n: uint,
priv pred: &'self fn(t: &T) -> bool,
/// An iterator over the slices of a vector separated by elements that
/// match a predicate function, from back to front.
pub struct RSplitIterator<'self, T> {
- // already priv
priv v: &'self [T],
priv n: uint,
priv pred: &'self fn(t: &T) -> bool,
/// The last generated swap is always (0, 1), and it returns the
/// sequence to its initial order.
pub struct ElementSwaps {
- // already priv
priv sdir: ~[SizeDirection],
/// If true, emit the last swap that returns the sequence to initial state
priv emit_reset: bool,
///
/// Generates even and odd permutations alternatingly.
pub struct Permutations<T> {
- // already priv
priv swaps: ElementSwaps,
priv v: ~[T],
}
/// a vector.
#[deriving(Clone)]
pub struct WindowIter<'self, T> {
- // already priv
priv v: &'self [T],
priv size: uint
}
/// the last slice of the iteration will be the remainder.
#[deriving(Clone)]
pub struct ChunkIter<'self, T> {
- // already priv
priv v: &'self [T],
priv size: uint
}
//iterator!{struct VecIterator -> *T, &'self T}
/// An iterator for iterating over a vector.
pub struct VecIterator<'self, T> {
- // already priv
priv ptr: *T,
priv end: *T,
priv lifetime: Option<&'self ()> // FIXME: #5922
//iterator!{struct VecMutIterator -> *mut T, &'self mut T}
/// An iterator for mutating the elements of a vector.
pub struct VecMutIterator<'self, T> {
- // already priv
priv ptr: *mut T,
priv end: *mut T,
priv lifetime: Option<&'self mut ()> // FIXME: #5922
/// An iterator that moves out of a vector.
#[deriving(Clone)]
pub struct MoveIterator<T> {
- // already priv
priv v: ~[T],
priv idx: uint,
}
/// An iterator that moves out of a vector in reverse order.
#[deriving(Clone)]
pub struct MoveRevIterator<T> {
- // already priv
priv v: ~[T]
}