]> git.lizzy.rs Git - rust.git/blob - src/libcore/prelude.rs
Merge pull request #20510 from tshepang/patch-6
[rust.git] / src / libcore / prelude.rs
1 // Copyright 2014 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 //! The core prelude
12 //!
13 //! This module is intended for users of libcore which do not link to libstd as
14 //! well. This module is not imported by default, but using the entire contents
15 //! of this module will provide all of the useful traits and types in libcore
16 //! that one would expect from the standard library as well.
17 //!
18 //! There is no method to automatically inject this prelude, and this prelude is
19 //! a subset of the standard library's prelude.
20 //!
21 //! # Example
22 //!
23 //! ```ignore
24 //! # fn main() {
25 //! #![feature(globs)]
26 //!
27 //! use core::prelude::*;
28 //! # }
29 //! ```
30
31 // Reexported core operators
32 pub use kinds::{Copy, Send, Sized, Sync};
33 pub use ops::{Drop, Fn, FnMut, FnOnce};
34
35 // Reexported functions
36 pub use iter::range;
37 pub use mem::drop;
38
39 // Reexported types and traits
40
41 pub use char::Char;
42 pub use clone::Clone;
43 pub use cmp::{PartialEq, PartialOrd, Eq, Ord};
44 pub use iter::{Extend, IteratorExt};
45 pub use iter::{Iterator, DoubleEndedIterator};
46 pub use iter::{IteratorCloneExt, CloneIteratorExt};
47 pub use iter::{IteratorOrdExt, ExactSizeIterator};
48 pub use option::Option::{self, Some, None};
49 pub use ptr::{PtrExt, MutPtrExt};
50 pub use result::Result::{self, Ok, Err};
51 pub use slice::{AsSlice, SliceExt};
52 pub use str::{Str, StrExt};