]> git.lizzy.rs Git - rust.git/blob - src/libcollections/lib.rs
Rewrite BTreeMap to use parent pointers.
[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/index.html) for a detailed discussion of
14 //! collections in Rust.
15
16 #![crate_name = "collections"]
17 #![crate_type = "rlib"]
18 #![unstable(feature = "collections",
19             reason = "library is unlikely to be stabilized with the current \
20                       layout and name, use std::collections instead",
21             issue = "27783")]
22 #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
23        html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
24        html_root_url = "https://doc.rust-lang.org/nightly/",
25        html_playground_url = "https://play.rust-lang.org/",
26        issue_tracker_base_url = "https://github.com/rust-lang/rust/issues/",
27        test(no_crate_inject, attr(allow(unused_variables), deny(warnings))))]
28
29 #![allow(trivial_casts)]
30 #![cfg_attr(test, allow(deprecated))] // rand
31
32 #![feature(alloc)]
33 #![feature(box_patterns)]
34 #![feature(box_syntax)]
35 #![feature(clone_from_slice)]
36 #![feature(core_intrinsics)]
37 #![feature(decode_utf16)]
38 #![feature(drop_in_place)]
39 #![feature(dropck_parametricity)]
40 #![feature(fmt_internals)]
41 #![feature(fmt_radix)]
42 #![feature(heap_api)]
43 #![feature(iter_arith)]
44 #![feature(iter_arith)]
45 #![feature(lang_items)]
46 #![feature(nonzero)]
47 #![feature(num_bits_bytes)]
48 #![feature(pattern)]
49 #![feature(shared)]
50 #![feature(slice_bytes)]
51 #![feature(slice_patterns)]
52 #![feature(staged_api)]
53 #![feature(step_by)]
54 #![feature(str_char)]
55 #![feature(unboxed_closures)]
56 #![feature(unicode)]
57 #![feature(unique)]
58 #![feature(unsafe_no_drop_flag)]
59 #![cfg_attr(test, feature(clone_from_slice, rand, test))]
60
61 #![no_std]
62
63 extern crate rustc_unicode;
64 extern crate alloc;
65
66 #[cfg(test)]
67 #[macro_use]
68 extern crate std;
69 #[cfg(test)]
70 extern crate test;
71
72 pub use binary_heap::BinaryHeap;
73 pub use btree_map::BTreeMap;
74 pub use btree_set::BTreeSet;
75 pub use linked_list::LinkedList;
76 pub use enum_set::EnumSet;
77 pub use vec_deque::VecDeque;
78 pub use string::String;
79 pub use vec::Vec;
80
81 // Needed for the vec! macro
82 pub use alloc::boxed;
83
84 #[macro_use]
85 mod macros;
86
87 pub mod binary_heap;
88 mod btree;
89 pub mod borrow;
90 pub mod enum_set;
91 pub mod fmt;
92 pub mod linked_list;
93 pub mod range;
94 pub mod slice;
95 pub mod str;
96 pub mod string;
97 pub mod vec;
98 pub mod vec_deque;
99
100 #[stable(feature = "rust1", since = "1.0.0")]
101 pub mod btree_map {
102     #[stable(feature = "rust1", since = "1.0.0")]
103     pub use btree::map::*;
104 }
105
106 #[stable(feature = "rust1", since = "1.0.0")]
107 pub mod btree_set {
108     #[stable(feature = "rust1", since = "1.0.0")]
109     pub use btree::set::*;
110 }
111
112 #[cfg(not(test))]
113 mod std {
114     pub use core::ops;      // RangeFull
115 }
116
117 /// An endpoint of a range of keys.
118 #[unstable(feature = "collections_bound", issue = "27787")]
119 #[derive(Clone, Copy, Debug, Hash, PartialEq, Eq)]
120 pub enum Bound<T> {
121     /// An inclusive bound.
122     Included(T),
123     /// An exclusive bound.
124     Excluded(T),
125     /// An infinite endpoint. Indicates that there is no bound in this direction.
126     Unbounded,
127 }