]> git.lizzy.rs Git - rust.git/blob - src/libcore/prelude.rs
a4d529ad47d09036fe32366fd9bd3150db89f4a6
[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 //! use core::prelude::*;
25 //! ```
26
27 // Reexported core operators
28 pub use marker::{Copy, Send, Sized, Sync};
29 pub use ops::{Drop, Fn, FnMut, FnOnce};
30
31 // Reexported functions
32 pub use mem::drop;
33
34 // Reexported types and traits
35
36 pub use char::CharExt;
37 pub use clone::Clone;
38 pub use cmp::{PartialEq, PartialOrd, Eq, Ord};
39 pub use convert::{AsRef, AsMut, Into, From};
40 pub use default::Default;
41 pub use iter::IntoIterator;
42 pub use iter::{Iterator, DoubleEndedIterator, Extend, ExactSizeIterator};
43 pub use option::Option::{self, Some, None};
44 pub use result::Result::{self, Ok, Err};
45 pub use slice::SliceExt;
46 pub use str::StrExt;