]> git.lizzy.rs Git - rust.git/blob - src/libstd/prelude.rs
auto merge of #13584 : rcxdude/rust/cross-syntax-ext, r=alexcrichton
[rust.git] / src / libstd / prelude.rs
1 // Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
4 //
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
10
11 /*!
12
13 The standard module imported by default into all Rust modules
14
15 Many programming languages have a 'prelude': a particular subset of the
16 libraries that come with the language. Every program imports the prelude by
17 default. The prelude imports various core parts of the library that are
18 generally useful to many Rust programs.
19
20 */
21
22 // Reexported core operators
23 pub use kinds::{Copy, Send, Sized, Share};
24 pub use ops::{Add, Sub, Mul, Div, Rem, Neg, Not};
25 pub use ops::{BitAnd, BitOr, BitXor};
26 pub use ops::{Drop, Deref, DerefMut};
27 pub use ops::{Shl, Shr, Index};
28 pub use option::{Option, Some, None};
29 pub use result::{Result, Ok, Err};
30
31 // Reexported functions
32 pub use from_str::from_str;
33 pub use iter::range;
34 pub use mem::drop;
35
36 // Reexported types and traits
37
38 pub use ascii::{Ascii, AsciiCast, OwnedAsciiCast, AsciiStr, IntoBytes};
39 pub use c_str::ToCStr;
40 pub use char::Char;
41 pub use clone::Clone;
42 pub use cmp::{Eq, Ord, TotalEq, TotalOrd, Ordering, Less, Equal, Greater, Equiv};
43 pub use container::{Container, Mutable, Map, MutableMap, Set, MutableSet};
44 pub use iter::{FromIterator, Extendable};
45 pub use iter::{Iterator, DoubleEndedIterator, RandomAccessIterator, CloneableIterator};
46 pub use iter::{OrdIterator, MutableDoubleEndedIterator, ExactSize};
47 pub use num::{Num, NumCast, CheckedAdd, CheckedSub, CheckedMul};
48 pub use num::{Signed, Unsigned};
49 pub use num::{Primitive, Int, Float, ToPrimitive, FromPrimitive};
50 pub use path::{GenericPath, Path, PosixPath, WindowsPath};
51 pub use ptr::RawPtr;
52 pub use io::{Buffer, Writer, Reader, Seek};
53 pub use str::{Str, StrVector, StrSlice, OwnedStr, IntoMaybeOwned};
54 pub use to_str::{ToStr, IntoStr};
55 pub use tuple::{Tuple1, Tuple2, Tuple3, Tuple4};
56 pub use tuple::{Tuple5, Tuple6, Tuple7, Tuple8};
57 pub use tuple::{Tuple9, Tuple10, Tuple11, Tuple12};
58 pub use slice::{ImmutableEqVector, ImmutableTotalOrdVector, ImmutableCloneableVector};
59 pub use slice::{OwnedVector};
60 pub use slice::{MutableVector, MutableTotalOrdVector};
61 pub use slice::{Vector, VectorVector, CloneableVector, ImmutableVector};
62 pub use strbuf::StrBuf;
63 pub use vec::Vec;
64
65 // Reexported runtime types
66 pub use comm::{sync_channel, channel, SyncSender, Sender, Receiver};
67 pub use task::spawn;
68
69 // Reexported statics
70 #[cfg(not(test))]
71 pub use gc::GC;