2013-01-18 01:28:42 -06:00
|
|
|
// Copyright 2013 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.
|
|
|
|
|
2013-06-02 22:46:12 -05:00
|
|
|
/*!
|
|
|
|
|
2013-12-24 10:08:28 -06:00
|
|
|
The standard module imported by default into all Rust modules
|
|
|
|
|
2013-06-02 22:46:12 -05:00
|
|
|
Many programming languages have a 'prelude': a particular subset of the
|
|
|
|
libraries that come with the language. Every program imports the prelude by
|
2014-02-19 21:05:31 -06:00
|
|
|
default. The prelude imports various core parts of the library that are
|
|
|
|
generally useful to many Rust programs.
|
2013-06-02 22:46:12 -05:00
|
|
|
|
|
|
|
*/
|
|
|
|
|
2013-05-24 21:35:29 -05:00
|
|
|
// Reexported core operators
|
2013-12-18 11:29:50 -06:00
|
|
|
pub use kinds::{Freeze, Pod, Send, Sized};
|
2013-05-01 00:40:05 -05:00
|
|
|
pub use ops::{Add, Sub, Mul, Div, Rem, Neg, Not};
|
2013-01-08 21:37:25 -06:00
|
|
|
pub use ops::{BitAnd, BitOr, BitXor};
|
2013-01-30 11:54:13 -06:00
|
|
|
pub use ops::{Drop};
|
2013-01-08 21:37:25 -06:00
|
|
|
pub use ops::{Shl, Shr, Index};
|
|
|
|
pub use option::{Option, Some, None};
|
|
|
|
pub use result::{Result, Ok, Err};
|
|
|
|
|
2013-05-24 21:35:29 -05:00
|
|
|
// Reexported functions
|
2013-09-04 23:48:48 -05:00
|
|
|
pub use from_str::from_str;
|
2013-10-21 14:41:32 -05:00
|
|
|
pub use iter::range;
|
2014-01-31 14:35:36 -06:00
|
|
|
pub use mem::drop;
|
2013-03-28 21:12:48 -05:00
|
|
|
|
2013-05-24 21:35:29 -05:00
|
|
|
// Reexported types and traits
|
2013-10-11 16:20:34 -05:00
|
|
|
|
|
|
|
pub use any::{Any, AnyOwnExt, AnyRefExt, AnyMutRefExt};
|
2013-12-14 08:04:22 -06:00
|
|
|
pub use ascii::{Ascii, AsciiCast, OwnedAsciiCast, AsciiStr, IntoBytes};
|
2013-10-21 14:41:32 -05:00
|
|
|
pub use bool::Bool;
|
2013-08-03 19:13:14 -05:00
|
|
|
pub use c_str::ToCStr;
|
2013-10-21 14:41:32 -05:00
|
|
|
pub use char::Char;
|
2013-05-14 23:45:40 -05:00
|
|
|
pub use clone::{Clone, DeepClone};
|
2014-01-08 05:57:31 -06:00
|
|
|
pub use cmp::{Eq, Ord, TotalEq, TotalOrd, Ordering, Less, Equal, Greater, Equiv};
|
2013-07-13 21:44:36 -05:00
|
|
|
pub use container::{Container, Mutable, Map, MutableMap, Set, MutableSet};
|
2013-10-21 14:41:32 -05:00
|
|
|
pub use default::Default;
|
|
|
|
pub use from_str::FromStr;
|
2013-09-08 10:01:16 -05:00
|
|
|
pub use iter::{FromIterator, Extendable};
|
2013-12-27 05:53:41 -06:00
|
|
|
pub use iter::{Iterator, DoubleEndedIterator, RandomAccessIterator, CloneableIterator};
|
2013-09-08 10:01:16 -05:00
|
|
|
pub use iter::{OrdIterator, MutableDoubleEndedIterator, ExactSize};
|
2014-02-16 14:20:01 -06:00
|
|
|
pub use num::{Num, NumCast, CheckedAdd, CheckedSub, CheckedMul};
|
2014-02-06 01:34:33 -06:00
|
|
|
pub use num::{Signed, Unsigned, Round};
|
2013-09-15 11:50:17 -05:00
|
|
|
pub use num::{Primitive, Int, Float, ToStrRadix, ToPrimitive, FromPrimitive};
|
2013-09-26 19:21:59 -05:00
|
|
|
pub use path::{GenericPath, Path, PosixPath, WindowsPath};
|
2013-06-03 12:50:29 -05:00
|
|
|
pub use ptr::RawPtr;
|
2013-11-13 13:17:58 -06:00
|
|
|
pub use io::{Buffer, Writer, Reader, Seek};
|
2014-02-07 18:36:59 -06:00
|
|
|
pub use str::{Str, StrVector, StrSlice, OwnedStr, IntoMaybeOwned};
|
2013-12-14 08:04:22 -06:00
|
|
|
pub use to_str::{ToStr, IntoStr};
|
2013-10-21 14:41:32 -05:00
|
|
|
pub use tuple::{Tuple1, Tuple2, Tuple3, Tuple4};
|
|
|
|
pub use tuple::{Tuple5, Tuple6, Tuple7, Tuple8};
|
|
|
|
pub use tuple::{Tuple9, Tuple10, Tuple11, Tuple12};
|
2014-01-28 16:42:40 -06:00
|
|
|
pub use vec::{ImmutableEqVector, ImmutableTotalOrdVector, ImmutableCloneableVector};
|
2014-02-10 09:14:58 -06:00
|
|
|
pub use vec::{OwnedVector, OwnedCloneableVector, OwnedEqVector};
|
2013-12-19 21:42:00 -06:00
|
|
|
pub use vec::{MutableVector, MutableTotalOrdVector};
|
2014-01-28 12:40:38 -06:00
|
|
|
pub use vec::{Vector, VectorVector, CloneableVector, ImmutableVector};
|
2013-01-08 21:37:25 -06:00
|
|
|
|
2013-05-24 21:35:29 -05:00
|
|
|
// Reexported runtime types
|
Rewrite channels yet again for upgradeability
This, the Nth rewrite of channels, is not a rewrite of the core logic behind
channels, but rather their API usage. In the past, we had the distinction
between oneshot, stream, and shared channels, but the most recent rewrite
dropped oneshots in favor of streams and shared channels.
This distinction of stream vs shared has shown that it's not quite what we'd
like either, and this moves the `std::comm` module in the direction of "one
channel to rule them all". There now remains only one Chan and one Port.
This new channel is actually a hybrid oneshot/stream/shared channel under the
hood in order to optimize for the use cases in question. Additionally, this also
reduces the cognitive burden of having to choose between a Chan or a SharedChan
in an API.
My simple benchmarks show no reduction in efficiency over the existing channels
today, and a 3x improvement in the oneshot case. I sadly don't have a
pre-last-rewrite compiler to test out the old old oneshots, but I would imagine
that the performance is comparable, but slightly slower (due to atomic reference
counting).
This commit also brings the bonus bugfix to channels that the pending queue of
messages are all dropped when a Port disappears rather then when both the Port
and the Chan disappear.
2014-01-08 20:31:48 -06:00
|
|
|
pub use comm::{Port, Chan};
|
2013-03-13 20:17:12 -05:00
|
|
|
pub use task::spawn;
|
2013-12-03 00:37:26 -06:00
|
|
|
|
2013-12-17 18:46:18 -06:00
|
|
|
// Reexported statics
|
|
|
|
#[cfg(not(test))]
|
|
|
|
pub use gc::GC;
|