]> git.lizzy.rs Git - rust.git/blob - src/libcore/prelude/v1.rs
Add transpose conversions for Option and Result
[rust.git] / src / libcore / prelude / v1.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 imported by default when `#![no_std]` is used in the
15 //! same manner as the standard library's prelude.
16
17 #![stable(feature = "core_prelude", since = "1.4.0")]
18
19 // Reexported core operators
20 #[stable(feature = "core_prelude", since = "1.4.0")]
21 #[doc(no_inline)]
22 pub use marker::{Copy, Send, Sized, Sync};
23 #[stable(feature = "core_prelude", since = "1.4.0")]
24 #[doc(no_inline)]
25 pub use ops::{Drop, Fn, FnMut, FnOnce};
26
27 // Reexported functions
28 #[stable(feature = "core_prelude", since = "1.4.0")]
29 #[doc(no_inline)]
30 pub use mem::drop;
31
32 // Reexported types and traits
33 #[stable(feature = "core_prelude", since = "1.4.0")]
34 #[doc(no_inline)]
35 pub use clone::Clone;
36 #[stable(feature = "core_prelude", since = "1.4.0")]
37 #[doc(no_inline)]
38 pub use cmp::{PartialEq, PartialOrd, Eq, Ord};
39 #[stable(feature = "core_prelude", since = "1.4.0")]
40 #[doc(no_inline)]
41 pub use convert::{AsRef, AsMut, Into, From};
42 #[stable(feature = "core_prelude", since = "1.4.0")]
43 #[doc(no_inline)]
44 pub use default::Default;
45 #[stable(feature = "core_prelude", since = "1.4.0")]
46 #[doc(no_inline)]
47 pub use iter::{Iterator, Extend, IntoIterator};
48 #[stable(feature = "core_prelude", since = "1.4.0")]
49 #[doc(no_inline)]
50 pub use iter::{DoubleEndedIterator, ExactSizeIterator};
51 #[stable(feature = "core_prelude", since = "1.4.0")]
52 #[doc(no_inline)]
53 pub use option::Option::{self, Some, None};
54 #[stable(feature = "core_prelude", since = "1.4.0")]
55 #[doc(no_inline)]
56 pub use result::Result::{self, Ok, Err};
57
58 // Reexported extension traits for primitive types
59 #[stable(feature = "core_prelude", since = "1.4.0")]
60 #[doc(no_inline)]
61 pub use slice::SliceExt;
62 #[stable(feature = "core_prelude", since = "1.4.0")]
63 #[doc(no_inline)]
64 pub use str::StrExt;
65 #[stable(feature = "core_prelude", since = "1.4.0")]
66 #[doc(no_inline)]
67 pub use char::CharExt;