* ~~~
*/
+#[allow(missing_doc)];
+
use core::prelude::*;
use sync;
// overhead when initializing plain-old-data and means we don't need
// to waste time running the destructors of POD.
+#[allow(missing_doc)];
+
use core::prelude::*;
use list::{MutList, MutCons, MutNil};
use core::str;
use core::vec;
+/// A trait for converting a value to base64 encoding.
pub trait ToBase64 {
+ /// Converts the value of `self` to a base64 value, returning the owned
+ /// string
fn to_base64(&self) -> ~str;
}
}
}
+#[allow(missing_doc)]
pub trait FromBase64 {
fn from_base64(&self) -> ~[u8];
}
enum Op {Union, Intersect, Assign, Difference}
-// The bitvector type
+/// The bitvector type
pub struct Bitv {
+ /// Internal representation of the bit vector (small or large)
rep: BitvVariant,
+ /// The number of valid bits in the internal representation
nbits: uint
}
//! Unsafe debugging functions for inspecting values.
+#[allow(missing_doc)];
+
use core::cast::transmute;
use core::sys;
static initial_capacity: uint = 32u; // 2^5
+#[allow(missing_doc)]
pub struct Deque<T> {
priv nelts: uint,
priv lo: uint,
pub type DListLink<T> = Option<@mut DListNode<T>>;
+#[allow(missing_doc)]
pub struct DListNode<T> {
data: T,
linked: bool, // for assertions
next: DListLink<T>,
}
+#[allow(missing_doc)]
pub struct DList<T> {
size: uint,
hd: DListLink<T>,
list
}
+/// Creates a new dlist from a vector of elements, maintaining the same order
pub fn from_vec<T:Copy>(vec: &[T]) -> @mut DList<T> {
do vec::foldl(DList(), vec) |list,data| {
list.push(*data); // Iterating left-to-right -- add newly to the tail.
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[allow(missing_doc)];
+
use core::prelude::*;
// Simple Extensible Binary Markup Language (ebml) reader and writer on a
}
*/
+#[allow(missing_doc)];
+
use core::prelude::*;
use core::io::ReaderUtil;
*/
+#[allow(missing_doc)];
+
use core::prelude::*;
use core::libc::{c_void, size_t, c_int};
*/
+#[allow(missing_doc)];
+
use core::prelude::*;
// The basic send/recv interface FlatChan and PortChan will implement
* ~~~
*/
+#[allow(missing_doc)];
+
use core::prelude::*;
use core::cast;
* ```
*/
+#[allow(missing_doc)];
+
use core::prelude::*;
use core::cmp::Eq;
use core::io::{Reader, BytesReader};
use core::io;
+/// An implementation of the io::Reader interface which reads a buffer of bytes
pub struct BufReader {
+ /// The buffer of bytes to read
buf: ~[u8],
+ /// The current position in the buffer of bytes
pos: @mut uint
}
-pub impl BufReader {
+impl BufReader {
+ /// Creates a new buffer reader for the specified buffer
pub fn new(v: ~[u8]) -> BufReader {
BufReader {
buf: v,
}
}
- priv fn as_bytes_reader<A>(&self, f: &fn(&BytesReader) -> A) -> A {
+ fn as_bytes_reader<A>(&self, f: &fn(&BytesReader) -> A) -> A {
// Recreating the BytesReader state every call since
// I can't get the borrowing to work correctly
let bytes_reader = BytesReader {
pub type Object = HashMap<~str, Json>;
#[deriving(Eq)]
+/// If an error occurs while parsing some JSON, this is the structure which is
+/// returned
pub struct Error {
+ /// The line number at which the error occurred
line: uint,
+ /// The column number at which the error occurred
col: uint,
+ /// A message describing the type of the error
msg: @~str,
}
return ss;
}
+/// A structure for implementing serialization to JSON.
pub struct Encoder {
priv wr: @io::Writer,
}
+/// Creates a new JSON encoder whose output will be written to the writer
+/// specified.
pub fn Encoder(wr: @io::Writer) -> Encoder {
Encoder {
wr: wr
}
}
+/// Another encoder for JSON, but prints out human-readable JSON instead of
+/// compact data
pub struct PrettyEncoder {
priv wr: @io::Writer,
priv indent: uint,
}
+/// Creates a new encoder whose output will be written to the specified writer
pub fn PrettyEncoder(wr: @io::Writer) -> PrettyEncoder {
PrettyEncoder {
wr: wr,
io::with_str_writer(|wr| to_pretty_writer(wr, json))
}
+#[allow(missing_doc)]
pub struct Parser {
priv rdr: @io::Reader,
priv ch: char,
}
}
+/// A structure to decode JSON to values in rust.
pub struct Decoder {
priv stack: ~[Json],
}
+/// Creates a new decoder instance for decoding the specified JSON value.
pub fn Decoder(json: Json) -> Decoder {
Decoder {
stack: ~[json]
fn gt(&self, other: &Json) -> bool { (*other).lt(&(*self)) }
}
-trait ToJson { fn to_json(&self) -> Json; }
+/// A trait for converting values to JSON
+trait ToJson {
+ /// Converts the value of `self` to an instance of JSON
+ fn to_json(&self) -> Json;
+}
impl ToJson for Json {
fn to_json(&self) -> Json { copy *self }
d: u32
}
+/// Calculates the md4 hash of the given slice of bytes, returning the 128-bit
+/// result as a quad of u32's
pub fn md4(msg: &[u8]) -> Quad {
// subtle: if orig_len is merely uint, then the code below
// which performs shifts by 32 bits or more has undefined
return Quad {a: a, b: b, c: c, d: d};
}
+/// Calculates the md4 hash of a slice of bytes, returning the hex-encoded
+/// version of the hash
pub fn md4_str(msg: &[u8]) -> ~str {
let Quad {a, b, c, d} = md4(msg);
fn app(a: u32, b: u32, c: u32, d: u32, f: &fn(u32)) {
result
}
+/// Calculates the md4 hash of a string, returning the hex-encoded version of
+/// the hash
pub fn md4_text(msg: &str) -> ~str { md4_str(str::to_bytes(msg)) }
#[test]
//! Types/fns concerning Internet Protocol (IP), versions 4 & 6
+#[allow(missing_doc)];
+
use core::prelude::*;
use core::libc;
//! High-level interface to libuv's TCP functionality
// FIXME #4425: Need FFI fixes
+#[allow(missing_doc)];
+
use core::prelude::*;
use future;
//! Types/fns concerning URLs (see RFC 3986)
+#[allow(missing_doc)];
+
use core::prelude::*;
use core::cmp::Eq;
}
+ /// Converts this big integer into a uint, returning the uint::max_value if
+ /// it's too large to fit in a uint.
pub fn to_uint(&self) -> uint {
match self.data.len() {
0 => 0,
/// A complex number in Cartesian form.
#[deriving(Eq,Clone)]
pub struct Cmplx<T> {
+ /// Real portion of the complex number
re: T,
+ /// Imaginary portion of the complex number
im: T
}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
-
//! Rational numbers
use core::prelude::*;
/// Represents the ratio between 2 numbers.
#[deriving(Clone)]
+#[allow(missing_doc)]
pub struct Ratio<T> {
numer: T,
denom: T
Ratio { numer: numer, denom: denom }
}
- // Create a new Ratio. Fails if `denom == 0`.
+ /// Create a new Ratio. Fails if `denom == 0`.
#[inline(always)]
pub fn new(numer: T, denom: T) -> Ratio<T> {
if denom == Zero::zero() {
use core::util::{replace, swap};
use core::vec;
+#[allow(missing_doc)]
pub struct PriorityQueue<T> {
priv data: ~[T],
}
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[allow(missing_doc)];
+
/** Task-local reference counted smart pointers
Task-local reference counted smart pointers are an alternative to managed boxes with deterministic
* * access to a character by index is logarithmic (linear in strings);
*/
+#[allow(missing_doc)];
+
use core::prelude::*;
use core::str;
//! Semver parsing and logic
+#[allow(missing_doc)];
+
use core::prelude::*;
use core::char;
Core encoding and decoding interfaces.
*/
+#[allow(missing_doc)];
#[forbid(non_camel_case_types)];
use core::prelude::*;
use core::util::replace;
use core::vec;
+#[allow(missing_doc)]
pub struct SmallIntMap<T> {
priv v: ~[Option<T>],
}
}
}
+/// A set implemented on top of the SmallIntMap type. This set is always a set
+/// of integers, and the space requirements are on the order of the highest
+/// valued integer in the set.
pub struct SmallIntSet {
priv map: SmallIntMap<()>
}
qsort3(arr, 0, (len - 1) as int);
}
+#[allow(missing_doc)]
pub trait Sort {
fn qsort(self);
}
static MIN_GALLOP: uint = 7;
static INITIAL_TMP_STORAGE: uint = 128;
+#[allow(missing_doc)]
pub fn tim_sort<T:Copy + Ord>(array: &mut [T]) {
let size = array.len();
if size < 2 {
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[allow(missing_doc)];
+
use core::prelude::*;
use core::vec;
#[crate_type = "lib"];
#[deny(non_camel_case_types)];
+#[deny(missing_doc)];
+
+// NOTE: remove these two attributes after the next snapshot
+#[no_core]; // for stage0
+#[allow(unrecognized_lint)]; // otherwise stage0 is seriously ugly
-#[no_core];
#[no_std];
extern mod core(name = "std", vers = "0.7-pre");
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[allow(missing_doc)];
+
/// A task pool abstraction. Useful for achieving predictable CPU
/// parallelism.
use core::rand::RngUtil;
use core::rand;
+/// Attempts to make a temporary directory inside of `tmpdir` whose name will
+/// have the suffix `suffix`. If no directory can be created, None is returned.
pub fn mkdtemp(tmpdir: &Path, suffix: &str) -> Option<Path> {
let mut r = rand::rng();
for 1000.times {
//! Simple ANSI color library
+#[allow(missing_doc)];
+
use core::prelude::*;
use core::io;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[allow(missing_doc)];
+
use core::prelude::*;
use core::i32;
// * union: |
// These would be convenient since the methods work like `each`
+#[allow(missing_doc)]
pub struct TreeMap<K, V> {
priv root: Option<~TreeNode<K, V>>,
priv length: uint
}
}
+/// A implementation of the `Set` trait on top of the `TreeMap` container. The
+/// only requirement is that the type of the elements contained ascribes to the
+/// `TotalOrd` trait.
pub struct TreeSet<T> {
priv map: TreeMap<T, ()>
}
// except according to those terms.
#[forbid(deprecated_mode)];
+#[allow(missing_doc)];
pub mod icu {
pub type UBool = u8;
* `interact` function you can execute code in a uv callback.
*/
+#[allow(missing_doc)];
+
use core::prelude::*;
use ll = uv_ll;
*/
#[allow(non_camel_case_types)]; // C types
+#[allow(missing_doc)];
use core::prelude::*;
// option. This file may not be copied, modified, or distributed
// except according to those terms.
+#[allow(missing_doc)];
+
use core::prelude::*;
use json;
//! Process spawning.
+#[allow(missing_doc)];
+
use cast;
use comm::{stream, SharedChan, GenericChan, GenericPort};
use int;