prelude.rs 2.2 KB
Newer Older
A
Alex Crichton 已提交
1 2 3 4 5 6 7 8 9 10 11 12
// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

//! The core prelude
//!
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
//! This module is intended for users of libcore which do not link to libstd as
//! well. This module is not imported by default, but using the entire contents
//! of this module will provide all of the useful traits and types in libcore
//! that one would expect from the standard library as well.
//!
//! There is no method to automatically inject this prelude, and this prelude is
//! a subset of the standard library's prelude.
//!
//! # Example
//!
//! ```ignore
//! # fn main() {
//! #![feature(globs)]
//!
//! use core::prelude::*;
//! # }
//! ```
A
Alex Crichton 已提交
30 31

// Reexported core operators
A
Alex Crichton 已提交
32
pub use kinds::{Copy, Send, Sized, Sync};
A
Alex Crichton 已提交
33 34 35
pub use ops::{Add, Sub, Mul, Div, Rem, Neg, Not};
pub use ops::{BitAnd, BitOr, BitXor};
pub use ops::{Drop, Deref, DerefMut};
36 37
pub use ops::{Shl, Shr};
pub use ops::{Index, IndexMut};
N
Nick Cameron 已提交
38
pub use ops::{Slice, SliceMut};
39
pub use ops::{Fn, FnMut, FnOnce};
A
Alex Crichton 已提交
40 41

// Reexported functions
42
pub use iter::{range, repeat};
A
Alex Crichton 已提交
43 44 45 46 47 48
pub use mem::drop;

// Reexported types and traits

pub use char::Char;
pub use clone::Clone;
49
pub use cmp::{PartialEq, PartialOrd, Eq, Ord};
50
pub use cmp::{Ordering, Less, Equal, Greater, Equiv};
G
gamazeps 已提交
51
pub use iter::{FromIterator, Extend};
A
Alex Crichton 已提交
52 53
pub use iter::{Iterator, DoubleEndedIterator, RandomAccessIterator, CloneableIterator};
pub use iter::{OrdIterator, MutableDoubleEndedIterator, ExactSize};
54
pub use num::{Signed, ToPrimitive, FromPrimitive};
55
pub use option::{Option, Some, None};
A
Alex Crichton 已提交
56
pub use ptr::RawPtr;
57
pub use result::{Result, Ok, Err};
58
pub use str::{Str, StrPrelude};
A
Alex Crichton 已提交
59 60 61
pub use tuple::{Tuple1, Tuple2, Tuple3, Tuple4};
pub use tuple::{Tuple5, Tuple6, Tuple7, Tuple8};
pub use tuple::{Tuple9, Tuple10, Tuple11, Tuple12};
62 63
pub use slice::{PartialEqSlicePrelude, OrdSlicePrelude};
pub use slice::{AsSlice, SlicePrelude};