devela/data/key/
reexports.rs
1use crate::reexport;
7
8#[cfg(feature = "alloc")]
9mod impls_alloc {
10 use super::*;
11 use crate::impl_cdef;
12
13 impl_cdef![<T> Self::new() => BTreeSet<T>];
15 impl_cdef![<K, V> Self::new() => BTreeMap<K, V>];
16}
17
18reexport! { rust: alloc::collections,
21 tag: crate::TAG_DATA_STRUCTURE!(),
22 doc: "An ordered map based on a B-Tree.",
23 BTreeMap
24}
25reexport! { rust: alloc::collections::btree_map,
26 doc: "An ordered map based on a B-Tree.",
27 @Entry as BTreeMapEntry
28}
29reexport! { rust: alloc::collections,
30 tag: crate::TAG_DATA_STRUCTURE!(),
31 doc: "An ordered set based on a B-Tree.",
32 BTreeSet
33}
34
35#[allow(unused_macros)]
38macro_rules! hashbrown_or_std {
39 (start) => {
40 "<span class='stab portability'
41 title='re-exported from either `hashbrown` or `std`'>`std?`</span>"
42 };
43 (end) => {
44 "\n\n*Re-exported from either the [`hashmap`](https://docs.rs/hasmap) crate
45 or from [`std::collections`](https::doc.rust-lang.org/std/collections)*.
46 \n\n---"
47 };
48}
49#[allow(unused_imports)]
50use hashbrown_or_std;
51
52#[cfg(feature = "dep_hashbrown")]
54pub use hashbrown_reexports::*;
55#[cfg(feature = "dep_hashbrown")]
56mod hashbrown_reexports {
57 use super::hashbrown_or_std;
58
59 #[doc = crate::TAG_DATA_STRUCTURE!()]
60 #[doc = hashbrown_or_std!(start)]
61 #[doc = hashbrown_or_std!(end)]
63 #[cfg_attr(
64 feature = "nightly_doc",
65 doc(cfg(any(feature = "dep_hashbrown", feature = "std")))
66 )]
67 pub use crate::_dep::hashbrown::HashMap;
68
69 #[doc = crate::TAG_DATA_STRUCTURE!()]
70 #[doc = hashbrown_or_std!(start)]
71 #[doc = hashbrown_or_std!(end)]
73 #[cfg_attr(
74 feature = "nightly_doc",
75 doc(cfg(any(feature = "dep_hashbrown", feature = "std")))
76 )]
77 pub use crate::_dep::hashbrown::hash_map::Entry as HashMapEntry;
78
79 #[doc = hashbrown_or_std!(start)]
80 #[doc = hashbrown_or_std!(end)]
82 #[cfg_attr(
83 feature = "nightly_doc",
84 doc(cfg(any(feature = "dep_hashbrown", feature = "std")))
85 )]
86 pub use crate::_dep::hashbrown::HashSet;
87}
88
89#[cfg(all(not(feature = "dep_hashbrown"), feature = "std"))]
90pub use std_reexports::*;
91#[cfg(all(not(feature = "dep_hashbrown"), feature = "std"))]
92mod std_reexports {
93 use super::hashbrown_or_std;
94
95 #[doc = hashbrown_or_std!(start)]
96 #[doc = hashbrown_or_std!(end)]
98 #[cfg_attr(
99 feature = "nightly_doc",
100 doc(cfg(any(feature = "dep_hashbrown", feature = "std")))
101 )]
102 pub use std::collections::hash_map::HashMap;
103
104 #[doc = hashbrown_or_std!(start)]
105 #[doc = hashbrown_or_std!(end)]
107 #[cfg_attr(
108 feature = "nightly_doc",
109 doc(cfg(any(feature = "dep_hashbrown", feature = "std")))
110 )]
111 pub use std::collections::hash_map::Entry as HashMapEntry;
112
113 #[doc = hashbrown_or_std!(start)]
114 #[doc = hashbrown_or_std!(end)]
116 #[cfg_attr(
117 feature = "nightly_doc",
118 doc(cfg(any(feature = "dep_hashbrown", feature = "std")))
119 )]
120 pub use std::collections::HashSet;
121}
122
123#[cfg(feature = "std")]
125#[cfg_attr(feature = "nightly_doc", doc(cfg(feature = "std")))]
126pub type HashMapStd<K, V> = std::collections::HashMap<K, V>;
127#[cfg(feature = "std")]
129#[cfg_attr(feature = "nightly_doc", doc(cfg(feature = "std")))]
130pub type HashSetStd<T> = std::collections::HashSet<T>;
131
132#[cfg(all(feature = "hash", any(feature = "std", feature = "dep_hashbrown")))]
133pub use aliases::*;
134#[cfg(all(feature = "hash", any(feature = "std", feature = "dep_hashbrown")))]
135#[cfg_attr(
136 feature = "nightly_doc",
137 doc(cfg(all(
138 feature = "hash",
139 any(feature = "std", all(feature = "dep_hashbrown", feature = "hash"))
140 )))
141)]
142mod aliases {
143 use super::{HashMap, HashSet};
144 use crate::HasherBuildFx;
145
146 pub type HashMapFx<K, V> = HashMap<K, V, HasherBuildFx>;
151
152 pub type HashSetFx<T> = HashSet<T, HasherBuildFx>;
157}