2013-01-18 01:28:42 -06:00
|
|
|
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
|
|
|
|
// file at the top-level directory of this distribution and at
|
|
|
|
// http://rust-lang.org/COPYRIGHT.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
// option. This file may not be copied, modified, or distributed
|
|
|
|
// except according to those terms.
|
|
|
|
|
2013-06-02 22:46:12 -05:00
|
|
|
/*!
|
|
|
|
|
|
|
|
Many programming languages have a 'prelude': a particular subset of the
|
|
|
|
libraries that come with the language. Every program imports the prelude by
|
|
|
|
default.
|
|
|
|
|
2013-06-06 15:34:50 -05:00
|
|
|
For example, it would be annoying to add `use std::io::println;` to every single
|
2013-06-02 22:46:12 -05:00
|
|
|
program, and the vast majority of Rust programs will wish to print to standard
|
|
|
|
output. Therefore, it makes sense to import it into every program.
|
|
|
|
|
|
|
|
Rust's prelude has three main parts:
|
|
|
|
|
|
|
|
1. io::print and io::println.
|
|
|
|
2. Core operators, such as `Add`, `Mul`, and `Not`.
|
|
|
|
3. Various types and traits, such as `Clone`, `Eq`, and `comm::Chan`.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2013-01-08 21:37:25 -06:00
|
|
|
|
2013-05-24 21:35:29 -05:00
|
|
|
// Reexported core operators
|
2013-01-30 11:55:33 -06:00
|
|
|
pub use either::{Either, Left, Right};
|
2013-07-10 16:43:25 -05:00
|
|
|
pub use kinds::Sized;
|
2013-06-05 19:56:24 -05:00
|
|
|
pub use kinds::{Freeze, Send};
|
2013-05-01 00:40:05 -05:00
|
|
|
pub use ops::{Add, Sub, Mul, Div, Rem, Neg, Not};
|
2013-01-08 21:37:25 -06:00
|
|
|
pub use ops::{BitAnd, BitOr, BitXor};
|
2013-01-30 11:54:13 -06:00
|
|
|
pub use ops::{Drop};
|
2013-01-08 21:37:25 -06:00
|
|
|
pub use ops::{Shl, Shr, Index};
|
|
|
|
pub use option::{Option, Some, None};
|
|
|
|
pub use result::{Result, Ok, Err};
|
|
|
|
|
2013-05-24 21:35:29 -05:00
|
|
|
// Reexported functions
|
2013-03-28 21:12:48 -05:00
|
|
|
pub use io::{print, println};
|
2013-08-01 17:35:46 -05:00
|
|
|
pub use iterator::range;
|
2013-03-28 21:12:48 -05:00
|
|
|
|
2013-05-24 21:35:29 -05:00
|
|
|
// Reexported types and traits
|
2013-05-14 23:45:40 -05:00
|
|
|
pub use clone::{Clone, DeepClone};
|
2013-05-06 01:10:26 -05:00
|
|
|
pub use cmp::{Eq, ApproxEq, Ord, TotalEq, TotalOrd, Ordering, Less, Equal, Greater, Equiv};
|
2013-05-18 14:50:02 -05:00
|
|
|
pub use char::Char;
|
2013-07-13 21:44:36 -05:00
|
|
|
pub use container::{Container, Mutable, Map, MutableMap, Set, MutableSet};
|
2013-01-30 11:54:13 -06:00
|
|
|
pub use hash::Hash;
|
2013-07-11 20:10:59 -05:00
|
|
|
pub use iter::Times;
|
|
|
|
pub use iterator::{Iterator, IteratorUtil, DoubleEndedIterator, DoubleEndedIteratorUtil};
|
2013-08-01 17:35:46 -05:00
|
|
|
pub use iterator::{ClonableIterator, OrdIterator};
|
2013-04-24 07:45:57 -05:00
|
|
|
pub use num::{Num, NumCast};
|
2013-04-29 00:33:55 -05:00
|
|
|
pub use num::{Orderable, Signed, Unsigned, Round};
|
2013-04-29 08:38:58 -05:00
|
|
|
pub use num::{Algebraic, Trigonometric, Exponential, Hyperbolic};
|
2013-04-29 00:33:55 -05:00
|
|
|
pub use num::{Integer, Fractional, Real, RealExt};
|
2013-04-26 01:27:51 -05:00
|
|
|
pub use num::{Bitwise, BitCount, Bounded};
|
2013-04-26 04:56:11 -05:00
|
|
|
pub use num::{Primitive, Int, Float};
|
2013-01-08 21:37:25 -06:00
|
|
|
pub use path::GenericPath;
|
2013-01-30 11:54:13 -06:00
|
|
|
pub use path::Path;
|
2013-01-08 21:37:25 -06:00
|
|
|
pub use path::PosixPath;
|
2013-01-30 11:54:13 -06:00
|
|
|
pub use path::WindowsPath;
|
2013-06-03 12:50:29 -05:00
|
|
|
pub use ptr::RawPtr;
|
2013-06-16 04:04:53 -05:00
|
|
|
pub use ascii::{Ascii, AsciiCast, OwnedAsciiCast, AsciiStr, ToBytesConsume};
|
2013-07-03 22:02:09 -05:00
|
|
|
pub use str::{Str, StrVector, StrSlice, OwnedStr};
|
2013-05-02 06:20:22 -05:00
|
|
|
pub use from_str::{FromStr};
|
2013-01-30 11:54:13 -06:00
|
|
|
pub use to_bytes::IterBytes;
|
2013-04-20 12:39:15 -05:00
|
|
|
pub use to_str::{ToStr, ToStrConsume};
|
2013-01-30 11:54:13 -06:00
|
|
|
pub use tuple::{CopyableTuple, ImmutableTuple, ExtendedTupleOps};
|
2013-05-18 07:46:02 -05:00
|
|
|
pub use tuple::{CloneableTuple2, CloneableTuple3, CloneableTuple4, CloneableTuple5};
|
|
|
|
pub use tuple::{CloneableTuple6, CloneableTuple7, CloneableTuple8, CloneableTuple9};
|
|
|
|
pub use tuple::{CloneableTuple10, CloneableTuple11, CloneableTuple12};
|
|
|
|
pub use tuple::{ImmutableTuple2, ImmutableTuple3, ImmutableTuple4, ImmutableTuple5};
|
|
|
|
pub use tuple::{ImmutableTuple6, ImmutableTuple7, ImmutableTuple8, ImmutableTuple9};
|
|
|
|
pub use tuple::{ImmutableTuple10, ImmutableTuple11, ImmutableTuple12};
|
2013-07-02 21:13:00 -05:00
|
|
|
pub use vec::{Vector, VectorVector, CopyableVector, ImmutableVector};
|
2013-06-28 22:35:25 -05:00
|
|
|
pub use vec::{ImmutableEqVector, ImmutableTotalOrdVector, ImmutableCopyableVector};
|
2013-06-28 22:41:09 -05:00
|
|
|
pub use vec::{OwnedVector, OwnedCopyableVector,OwnedEqVector, MutableVector};
|
2013-03-20 14:49:22 -05:00
|
|
|
pub use io::{Reader, ReaderUtil, Writer, WriterUtil};
|
2013-01-08 21:37:25 -06:00
|
|
|
|
2013-05-24 21:35:29 -05:00
|
|
|
// Reexported runtime types
|
2013-03-13 20:17:12 -05:00
|
|
|
pub use comm::{stream, Port, Chan, GenericChan, GenericSmartChan, GenericPort, Peekable};
|
|
|
|
pub use task::spawn;
|