]> git.lizzy.rs Git - rust.git/blob - src/libcollections/lib.rs
doc: remove incomplete sentence
[rust.git] / src / libcollections / lib.rs
1 // Copyright 2013-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 //! Collection types.
12 //!
13 //! See [std::collections](../std/collections) for a detailed discussion of collections in Rust.
14
15
16 #![crate_name = "collections"]
17 #![experimental]
18 #![crate_type = "rlib"]
19 #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
20        html_favicon_url = "http://www.rust-lang.org/favicon.ico",
21        html_root_url = "http://doc.rust-lang.org/nightly/",
22        html_playground_url = "http://play.rust-lang.org/")]
23
24 #![allow(unknown_features)]
25 #![feature(macro_rules, default_type_params, phase, globs)]
26 #![feature(unsafe_destructor, slicing_syntax)]
27 #![feature(unboxed_closures)]
28 #![feature(old_orphan_check)]
29 #![feature(associated_types)]
30 #![no_std]
31
32 #[phase(plugin, link)] extern crate core;
33 extern crate unicode;
34 extern crate alloc;
35
36 #[cfg(test)] extern crate test;
37
38 #[cfg(test)] #[phase(plugin, link)] extern crate std;
39 #[cfg(test)] #[phase(plugin, link)] extern crate log;
40
41
42 pub use binary_heap::BinaryHeap;
43 pub use bitv::Bitv;
44 pub use bitv_set::BitvSet;
45 pub use btree_map::BTreeMap;
46 pub use btree_set::BTreeSet;
47 pub use dlist::DList;
48 pub use enum_set::EnumSet;
49 pub use ring_buf::RingBuf;
50 pub use string::String;
51 pub use vec::Vec;
52 pub use vec_map::VecMap;
53
54 mod macros;
55
56 pub mod binary_heap;
57 mod bit;
58 mod btree;
59 pub mod dlist;
60 pub mod enum_set;
61 pub mod ring_buf;
62 pub mod slice;
63 pub mod str;
64 pub mod string;
65 pub mod vec;
66 pub mod vec_map;
67
68 pub mod bitv {
69     pub use bit::{Bitv, Iter, from_fn, from_bytes};
70 }
71
72 pub mod bitv_set {
73     pub use bit::{BitvSet, Union, Intersection, Difference, SymmetricDifference};
74     pub use bit::SetIter as Iter;
75 }
76
77 pub mod btree_map {
78     pub use btree::map::*;
79 }
80
81 pub mod btree_set {
82     pub use btree::set::*;
83 }
84
85
86 #[cfg(test)] mod bench;
87
88 // FIXME(#14344) this shouldn't be necessary
89 #[doc(hidden)]
90 pub fn fixme_14344_be_sure_to_link_to_collections() {}
91
92 #[cfg(not(test))]
93 mod std {
94     pub use core::fmt;      // necessary for panic!()
95     pub use core::option;   // necessary for panic!()
96     pub use core::clone;    // deriving(Clone)
97     pub use core::cmp;      // deriving(Eq, Ord, etc.)
98     pub use core::kinds;    // deriving(Copy)
99     pub use core::hash;     // deriving(Hash)
100 }
101
102 #[cfg(test)]
103 mod prelude {
104     // from core.
105     pub use core::borrow::IntoCow;
106     pub use core::char::Char;
107     pub use core::clone::Clone;
108     pub use core::cmp::{PartialEq, Eq, Equiv, PartialOrd, Ord};
109     pub use core::cmp::Ordering::{Less, Equal, Greater};
110     pub use core::iter::range;
111     pub use core::iter::{FromIterator, Extend, IteratorExt};
112     pub use core::iter::{Iterator, DoubleEndedIterator, RandomAccessIterator};
113     pub use core::iter::{IteratorCloneExt, CloneIteratorExt};
114     pub use core::iter::{IteratorOrdExt, MutableDoubleEndedIterator, ExactSizeIterator};
115     pub use core::kinds::{Copy, Send, Sized, Sync};
116     pub use core::mem::drop;
117     pub use core::ops::{Drop, Fn, FnMut, FnOnce};
118     pub use core::option::Option;
119     pub use core::option::Option::{Some, None};
120     pub use core::ptr::PtrExt;
121     pub use core::result::Result;
122     pub use core::result::Result::{Ok, Err};
123
124     // in core and collections (may differ).
125     pub use slice::{AsSlice, SliceExt};
126     pub use str::{from_str, Str, StrExt};
127
128     // from other crates.
129     pub use alloc::boxed::Box;
130     pub use unicode::char::UnicodeChar;
131
132     // from collections.
133     pub use slice::SliceConcatExt;
134     pub use str::IntoMaybeOwned;
135     pub use string::{String, ToString};
136     pub use vec::Vec;
137 }