3 #![stable(feature = "rust1", since = "1.0.0")]
10 #[stable(feature = "rust1", since = "1.0.0")]
12 //! A map based on a B-Tree.
13 #[stable(feature = "rust1", since = "1.0.0")]
14 pub use super::btree::map::*;
17 #[stable(feature = "rust1", since = "1.0.0")]
19 //! A set based on a B-Tree.
20 #[stable(feature = "rust1", since = "1.0.0")]
21 pub use super::btree::set::*;
24 #[stable(feature = "rust1", since = "1.0.0")]
26 pub use binary_heap::BinaryHeap;
28 #[stable(feature = "rust1", since = "1.0.0")]
30 pub use btree_map::BTreeMap;
32 #[stable(feature = "rust1", since = "1.0.0")]
34 pub use btree_set::BTreeSet;
36 #[stable(feature = "rust1", since = "1.0.0")]
38 pub use linked_list::LinkedList;
40 #[stable(feature = "rust1", since = "1.0.0")]
42 pub use vec_deque::VecDeque;
44 use crate::alloc::{Layout, LayoutErr};
46 /// The error type for `try_reserve` methods.
47 #[derive(Clone, PartialEq, Eq, Debug)]
48 #[unstable(feature = "try_reserve", reason = "new API", issue = "48043")]
49 pub enum TryReserveError {
50 /// Error due to the computed capacity exceeding the collection's maximum
51 /// (usually `isize::MAX` bytes).
54 /// The memory allocator returned an error
56 /// The layout of allocation request that failed
61 feature = "container_error_extra",
64 Enable exposing the allocator’s custom error value \
65 if an associated type is added in the future: \
66 https://github.com/rust-lang/wg-allocators/issues/23"
72 #[unstable(feature = "try_reserve", reason = "new API", issue = "48043")]
73 impl From<LayoutErr> for TryReserveError {
75 fn from(_: LayoutErr) -> Self {
76 TryReserveError::CapacityOverflow
80 /// An intermediate trait for specialization of `Extend`.
82 trait SpecExtend<I: IntoIterator> {
83 /// Extends `self` with the contents of the given iterator.
84 fn spec_extend(&mut self, iter: I);