1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
#![crate_id = "collections#0.11.0"]
#![experimental]
#![crate_type = "rlib"]
#![license = "MIT/ASL2"]
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
html_root_url = "http://doc.rust-lang.org/0.11.0/",
html_playground_url = "http://play.rust-lang.org/")]
#![feature(macro_rules, managed_boxes, default_type_params, phase, globs)]
#![feature(unsafe_destructor)]
#![no_std]
#[phase(plugin, link)] extern crate core;
extern crate alloc;
#[cfg(test)] extern crate native;
#[cfg(test)] extern crate test;
#[cfg(test)] extern crate debug;
#[cfg(test)] #[phase(plugin, link)] extern crate std;
#[cfg(test)] #[phase(plugin, link)] extern crate log;
use core::prelude::*;
pub use core::collections::Collection;
pub use bitv::{Bitv, BitvSet};
pub use btree::BTree;
pub use dlist::DList;
pub use enum_set::EnumSet;
pub use priority_queue::PriorityQueue;
pub use ringbuf::RingBuf;
pub use smallintmap::SmallIntMap;
pub use string::String;
pub use treemap::{TreeMap, TreeSet};
pub use trie::{TrieMap, TrieSet};
pub use vec::Vec;
mod macros;
pub mod bitv;
pub mod btree;
pub mod dlist;
pub mod enum_set;
pub mod priority_queue;
pub mod ringbuf;
pub mod smallintmap;
pub mod treemap;
pub mod trie;
pub mod slice;
pub mod str;
pub mod string;
pub mod vec;
pub mod hash;mod unicode;
mod deque;
pub trait Mutable: Collection {
fn clear(&mut self);
}
pub trait Map<K, V>: Collection {
fn find<'a>(&'a self, key: &K) -> Option<&'a V>;
#[inline]
fn contains_key(&self, key: &K) -> bool {
self.find(key).is_some()
}
}
pub trait MutableMap<K, V>: Map<K, V> + Mutable {
#[inline]
fn insert(&mut self, key: K, value: V) -> bool {
self.swap(key, value).is_none()
}
#[inline]
fn remove(&mut self, key: &K) -> bool {
self.pop(key).is_some()
}
fn swap(&mut self, k: K, v: V) -> Option<V>;
fn pop(&mut self, k: &K) -> Option<V>;
fn find_mut<'a>(&'a mut self, key: &K) -> Option<&'a mut V>;
}
pub trait Set<T>: Collection {
fn contains(&self, value: &T) -> bool;
fn is_disjoint(&self, other: &Self) -> bool;
fn is_subset(&self, other: &Self) -> bool;
fn is_superset(&self, other: &Self) -> bool {
other.is_subset(self)
}}
pub trait MutableSet<T>: Set<T> + Mutable {
fn insert(&mut self, value: T) -> bool;
fn remove(&mut self, value: &T) -> bool;
}
pub trait Deque<T> : Mutable {
fn front<'a>(&'a self) -> Option<&'a T>;
fn front_mut<'a>(&'a mut self) -> Option<&'a mut T>;
fn back<'a>(&'a self) -> Option<&'a T>;
fn back_mut<'a>(&'a mut self) -> Option<&'a mut T>;
fn push_front(&mut self, elt: T);
fn push_back(&mut self, elt: T);
fn pop_back(&mut self) -> Option<T>;
fn pop_front(&mut self) -> Option<T>;
}#[doc(hidden)]
pub fn fixme_14344_be_sure_to_link_to_collections() {}
#[cfg(not(test))]
mod std {
pub use core::fmt;pub use core::option;pub use core::clone;pub use core::cmp;pub use hash;}