]> git.proxmox.com Git - rustc.git/blob - src/libcore/prelude.rs
Imported Upstream version 1.2.0+dfsg1
[rustc.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 #![unstable(feature = "core_prelude",
28 reason = "the libcore prelude has not been scrutinized and \
29 stabilized yet")]
30
31 // Reexported core operators
32 pub use marker::{Copy, Send, Sized, Sync};
33 pub use ops::{Drop, Fn, FnMut, FnOnce};
34
35 // Reexported functions
36 pub use mem::drop;
37
38 // Reexported types and traits
39 pub use char::CharExt;
40 pub use clone::Clone;
41 pub use cmp::{PartialEq, PartialOrd, Eq, Ord};
42 pub use convert::{AsRef, AsMut, Into, From};
43 pub use default::Default;
44 pub use iter::IntoIterator;
45 pub use iter::{Iterator, DoubleEndedIterator, Extend, ExactSizeIterator};
46 pub use option::Option::{self, Some, None};
47 pub use result::Result::{self, Ok, Err};
48 pub use slice::SliceExt;
49 pub use str::StrExt;