]> git.lizzy.rs Git - rust.git/blob - src/libstd/prelude/mod.rs
std: Update crate docs
[rust.git] / src / libstd / prelude / mod.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 Rust Prelude
12 //!
13 //! Because `std` is required by most serious Rust software, it is
14 //! imported at the topmost level of every crate by default, as if the
15 //! first line of each crate was
16 //!
17 //! ```ignore
18 //! extern crate std;
19 //! ```
20 //!
21 //! This means that the contents of std can be accessed from any context
22 //! with the `std::` path prefix, as in `use std::vec`, `use std::task::spawn`,
23 //! etc.
24 //!
25 //! Additionally, `std` contains a `prelude` module that reexports many of the
26 //! most common traits, types and functions. The contents of the prelude are
27 //! imported into every *module* by default.  Implicitly, all modules behave as if
28 //! they contained the following prologue:
29 //!
30 //! ```ignore
31 //! use std::prelude::v1::*;
32 //! ```
33 //!
34 //! The prelude is primarily concerned with exporting *traits* that are so
35 //! pervasive that it would be obnoxious to import for every use, particularly
36 //! those that define methods on primitive types.
37
38 #![stable(feature = "rust1", since = "1.0.0")]
39
40 pub mod v1;