2013-01-17 23:28:42 -08: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 20:46:12 -07:00
|
|
|
/*!
|
|
|
|
|
2013-12-24 17:08:28 +01:00
|
|
|
The standard module imported by default into all Rust modules
|
|
|
|
|
2013-06-02 20:46:12 -07: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 22:34:50 +02:00
|
|
|
For example, it would be annoying to add `use std::io::println;` to every single
|
2013-06-02 20:46:12 -07: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-05-24 19:35:29 -07:00
|
|
|
// Reexported core operators
|
2013-12-18 09:29:50 -08:00
|
|
|
pub use kinds::{Freeze, Pod, Send, Sized};
|
2013-05-01 15:40:05 +10:00
|
|
|
pub use ops::{Add, Sub, Mul, Div, Rem, Neg, Not};
|
2013-01-08 19:37:25 -08:00
|
|
|
pub use ops::{BitAnd, BitOr, BitXor};
|
2013-01-30 09:54:13 -08:00
|
|
|
pub use ops::{Drop};
|
2013-01-08 19:37:25 -08:00
|
|
|
pub use ops::{Shl, Shr, Index};
|
|
|
|
pub use option::{Option, Some, None};
|
|
|
|
pub use result::{Result, Ok, Err};
|
|
|
|
|
2013-05-24 19:35:29 -07:00
|
|
|
// Reexported functions
|
2013-09-05 00:48:48 -04:00
|
|
|
pub use from_str::from_str;
|
2013-10-21 21:41:32 +02:00
|
|
|
pub use iter::range;
|
2013-11-10 22:46:32 -08:00
|
|
|
pub use io::stdio::{print, println};
|
2013-03-28 19:12:48 -07:00
|
|
|
|
2013-05-24 19:35:29 -07:00
|
|
|
// Reexported types and traits
|
2013-10-11 23:20:34 +02:00
|
|
|
|
|
|
|
pub use any::{Any, AnyOwnExt, AnyRefExt, AnyMutRefExt};
|
2013-12-15 01:04:22 +11:00
|
|
|
pub use ascii::{Ascii, AsciiCast, OwnedAsciiCast, AsciiStr, IntoBytes};
|
2013-10-21 21:41:32 +02:00
|
|
|
pub use bool::Bool;
|
2013-08-03 17:13:14 -07:00
|
|
|
pub use c_str::ToCStr;
|
2013-10-21 21:41:32 +02:00
|
|
|
pub use char::Char;
|
2013-05-15 00:45:40 -04:00
|
|
|
pub use clone::{Clone, DeepClone};
|
2013-05-06 16:10:26 +10:00
|
|
|
pub use cmp::{Eq, ApproxEq, Ord, TotalEq, TotalOrd, Ordering, Less, Equal, Greater, Equiv};
|
2013-07-13 19:44:36 -07:00
|
|
|
pub use container::{Container, Mutable, Map, MutableMap, Set, MutableSet};
|
2013-10-21 21:41:32 +02:00
|
|
|
pub use default::Default;
|
|
|
|
pub use from_str::FromStr;
|
2013-01-30 09:54:13 -08:00
|
|
|
pub use hash::Hash;
|
2013-09-08 11:01:16 -04:00
|
|
|
pub use iter::{FromIterator, Extendable};
|
2013-12-27 13:53:41 +02:00
|
|
|
pub use iter::{Iterator, DoubleEndedIterator, RandomAccessIterator, CloneableIterator};
|
2013-09-08 11:01:16 -04:00
|
|
|
pub use iter::{OrdIterator, MutableDoubleEndedIterator, ExactSize};
|
2013-10-21 21:41:32 +02:00
|
|
|
pub use num::Times;
|
2013-04-29 23:38:58 +10:00
|
|
|
pub use num::{Algebraic, Trigonometric, Exponential, Hyperbolic};
|
2013-04-26 16:27:51 +10:00
|
|
|
pub use num::{Bitwise, BitCount, Bounded};
|
2013-10-21 21:41:32 +02:00
|
|
|
pub use num::{Integer, Fractional, Real, RealExt};
|
|
|
|
pub use num::{Num, NumCast, CheckedAdd, CheckedSub, CheckedMul};
|
|
|
|
pub use num::{Orderable, Signed, Unsigned, Round};
|
2013-09-15 09:50:17 -07:00
|
|
|
pub use num::{Primitive, Int, Float, ToStrRadix, ToPrimitive, FromPrimitive};
|
2013-09-26 17:21:59 -07:00
|
|
|
pub use path::{GenericPath, Path, PosixPath, WindowsPath};
|
2013-06-03 13:50:29 -04:00
|
|
|
pub use ptr::RawPtr;
|
2013-11-13 11:17:58 -08:00
|
|
|
pub use io::{Buffer, Writer, Reader, Seek};
|
2013-09-14 19:37:45 +02:00
|
|
|
pub use send_str::{SendStr, SendStrOwned, SendStrStatic, IntoSendStr};
|
2013-07-03 20:02:09 -07:00
|
|
|
pub use str::{Str, StrVector, StrSlice, OwnedStr};
|
2013-01-30 09:54:13 -08:00
|
|
|
pub use to_bytes::IterBytes;
|
2013-12-15 01:04:22 +11:00
|
|
|
pub use to_str::{ToStr, IntoStr};
|
2013-08-13 21:00:58 -04:00
|
|
|
pub use tuple::{CopyableTuple, ImmutableTuple};
|
2013-10-21 21:41:32 +02:00
|
|
|
pub use tuple::{ImmutableTuple1, ImmutableTuple2, ImmutableTuple3, ImmutableTuple4};
|
|
|
|
pub use tuple::{ImmutableTuple5, ImmutableTuple6, ImmutableTuple7, ImmutableTuple8};
|
|
|
|
pub use tuple::{ImmutableTuple9, ImmutableTuple10, ImmutableTuple11, ImmutableTuple12};
|
|
|
|
pub use tuple::{Tuple1, Tuple2, Tuple3, Tuple4};
|
|
|
|
pub use tuple::{Tuple5, Tuple6, Tuple7, Tuple8};
|
|
|
|
pub use tuple::{Tuple9, Tuple10, Tuple11, Tuple12};
|
2013-06-29 13:35:25 +10:00
|
|
|
pub use vec::{ImmutableEqVector, ImmutableTotalOrdVector, ImmutableCopyableVector};
|
2013-12-20 14:42:00 +11:00
|
|
|
pub use vec::{OwnedVector, OwnedCopyableVector,OwnedEqVector};
|
|
|
|
pub use vec::{MutableVector, MutableTotalOrdVector};
|
2013-10-21 21:41:32 +02:00
|
|
|
pub use vec::{Vector, VectorVector, CopyableVector, ImmutableVector};
|
2013-01-08 19:37:25 -08:00
|
|
|
|
2013-05-24 19:35:29 -07:00
|
|
|
// Reexported runtime types
|
2013-12-05 18:19:06 -08:00
|
|
|
pub use comm::{Port, Chan, SharedChan};
|
2013-03-13 18:17:12 -07:00
|
|
|
pub use task::spawn;
|
2013-12-02 22:37:26 -08:00
|
|
|
|
|
|
|
/// Disposes of a value.
|
|
|
|
#[inline]
|
|
|
|
pub fn drop<T>(_x: T) { }
|