Module std::prelude

Many programming languages have a 'prelude': a particular subset of the libraries that come with the language. Every program imports the prelude by default.

For example, it would be annoying to add use std::io::println; to every single 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.

Reexports

pub use num::{Bitwise, BitCount, Bounded};
pub use num::{Primitive, Int, Float, ToStrRadix};
pub use either::{Either, Left, Right};
pub use path::GenericPath;
pub use kinds::{Freeze, Send};
pub use path::Path;
pub use ops::{BitAnd, BitOr, BitXor};
pub use path::PosixPath;
pub use ops::{Shl, Shr, Index};
pub use path::WindowsPath;
pub use result::{Result, Ok, Err};
pub use ptr::RawPtr;
pub use iter::range;
pub use ascii::{Ascii, AsciiCast, OwnedAsciiCast, AsciiStr, ToBytesConsume};
pub use c_str::ToCStr;
pub use send_str::{SendStr, SendStrOwned, SendStrStatic, IntoSendStr};
pub use cmp::{Eq, ApproxEq, Ord, TotalEq, TotalOrd, Ordering, Less, Equal, Greater, Equiv};
pub use str::{Str, StrVector, StrSlice, OwnedStr};
pub use container::{Container, Mutable, Map, MutableMap, Set, MutableSet};
pub use from_str::FromStr;
pub use num::Times;
pub use to_bytes::IterBytes;
pub use iter::{Iterator, DoubleEndedIterator, RandomAccessIterator, ClonableIterator};
pub use to_str::{ToStr, ToStrConsume};
pub use num::{Num, NumCast, CheckedAdd, CheckedSub, CheckedMul};
pub use tuple::{CopyableTuple, ImmutableTuple};
pub use num::{Algebraic, Trigonometric, Exponential, Hyperbolic};
pub use tuple::{Tuple1, ImmutableTuple1};
pub use task::spawn;
pub use tuple::{Tuple2, Tuple3, Tuple4, Tuple5};
pub use ops::{Add, Sub, Mul, Div, Rem, Neg, Not};
pub use tuple::{Tuple6, Tuple7, Tuple8, Tuple9};
pub use option::{Option, Some, None};
pub use tuple::{Tuple10, Tuple11, Tuple12};
pub use from_str::from_str;
pub use tuple::{ImmutableTuple2, ImmutableTuple3, ImmutableTuple4, ImmutableTuple5};
pub use char::Char;
pub use tuple::{ImmutableTuple6, ImmutableTuple7, ImmutableTuple8, ImmutableTuple9};
pub use iter::{FromIterator, Extendable};
pub use tuple::{ImmutableTuple10, ImmutableTuple11, ImmutableTuple12};
pub use num::{Orderable, Signed, Unsigned, Round};
pub use vec::{Vector, VectorVector, CopyableVector, ImmutableVector};
pub use kinds::Sized;
pub use vec::{ImmutableEqVector, ImmutableTotalOrdVector, ImmutableCopyableVector};
pub use io::{print, println};
pub use vec::{OwnedVector, OwnedCopyableVector, OwnedEqVector, MutableVector};
pub use hash::Hash;
pub use io::{Reader, ReaderUtil, Writer, WriterUtil};
pub use num::{Integer, Fractional, Real, RealExt};
pub use default::Default;
pub use clone::{Clone, DeepClone};
pub use comm::{stream, Port, Chan, GenericChan, GenericSmartChan, GenericPort, Peekable};
pub use ops::{Drop};
pub use iter::{OrdIterator, MutableDoubleEndedIterator, ExactSize};