wiwi_chain/map.rs
1use crate::prelude_internal::*;
2use std::hash::{ BuildHasher, Hash };
3
4impl_chain_conversions! { [K, V, S] std::collections::HashMap<K, V, S> }
5impl_chain_conversions! { [K, V] std::collections::BTreeMap<K, V> }
6impl_chain_conversions! {
7 #[cfg(feature = "hashbrown")]
8 [K, V, S] hashbrown::HashMap<K, V, S>
9}
10
11chain_fns! {
12 impl and_mut [K, V, S] { doc "HashMap" "std::collections::HashMap" } std::collections::HashMap<K, V, S>;
13 impl and_mut [K, V] { doc "BTreeMap" "std::collections::BTreeMap" } std::collections::BTreeMap<K, V>;
14 #[cfg(feature = "hashbrown")]
15 impl and_mut [K, V, S] { doc "HashMap" "hashbrown::HashMap" } hashbrown::HashMap<K, V, S>;
16
17 doc [Self]
18 fn clear(inner) {
19 inner.clear()
20 }
21
22 doc [Self]
23 fn len(inner, out: impl Output<usize>) {
24 out.write(inner.len())
25 }
26}
27
28chain_fns! {
29 impl and_mut [K, V, S] { doc "HashMap" "std::collections::HashMap" } std::collections::HashMap<K, V, S>;
30 #[cfg(feature = "hashbrown")]
31 impl and_mut [K, V, S] { doc "HashMap" "hashbrown::HashMap" } hashbrown::HashMap<K, V, S>;
32
33 doc [Self]
34 fn insert(inner, k: K, v: V, out: impl Output<Option<V>>)
35 where {
36 K: Eq + Hash,
37 S: BuildHasher
38 } {
39 out.write(inner.insert(k, v))
40 }
41}
42
43chain_fns! {
44 impl and_mut [K, V] { doc "BTreeMap" "std::collections::BTreeMap" } std::collections::BTreeMap<K, V>;
45
46 doc [Self]
47 fn insert(inner, k: K, v: V, out: impl Output<Option<V>>)
48 where {
49 K: Ord
50 } {
51 out.write(inner.insert(k, v))
52 }
53}
54
55/*
56std
57Methods
58capacity
59clear
60contains_key
61drain
62entry
63extract_if
64get
65get_disjoint_mut
66get_disjoint_unchecked_mut
67get_key_value
68get_mut
69hasher
70insert
71into_keys
72into_values
73is_empty
74iter
75iter_mut
76keys
77len
78new
79remove
80remove_entry
81reserve
82retain
83shrink_to
84shrink_to_fit
85try_insert
86try_reserve
87values
88values_mut
89with_capacity
90with_capacity_and_hasher
91with_hasher
92Trait Implementations
93Clone
94Debug
95Default
96Eq
97Extend<(&'a K, &'a V)>
98Extend<(K, V)>
99From<[(K, V); N]>
100FromIterator<(K, V)>
101Index<&Q>
102IntoIterator
103IntoIterator
104IntoIterator
105PartialEq
106UnwindSafe
107
108
109btree
110Methods
111append
112clear
113contains_key
114entry
115extract_if
116first_entry
117first_key_value
118get
119get_key_value
120get_mut
121insert
122into_keys
123into_values
124is_empty
125iter
126iter_mut
127keys
128last_entry
129last_key_value
130len
131lower_bound
132lower_bound_mut
133new
134new_in
135pop_first
136pop_last
137range
138range_mut
139remove
140remove_entry
141retain
142split_off
143try_insert
144upper_bound
145upper_bound_mut
146values
147values_mut
148Trait Implementations
149Clone
150Debug
151Default
152Drop
153Eq
154Extend<(&'a K, &'a V)>
155Extend<(K, V)>
156From<[(K, V); N]>
157FromIterator<(K, V)>
158Hash
159Index<&Q>
160IntoIterator
161IntoIterator
162IntoIterator
163Ord
164PartialEq
165PartialOrd
166UnwindSafe
167
168
169hashbrown
170Methods
171allocation_size
172allocator
173capacity
174clear
175contains_key
176drain
177entry
178entry_ref
179extract_if
180get
181get_key_value
182get_key_value_mut
183get_many_key_value_mut
184get_many_key_value_unchecked_mut
185get_many_mut
186get_many_unchecked_mut
187get_mut
188hasher
189insert
190insert_unique_unchecked
191into_keys
192into_values
193is_empty
194iter
195iter_mut
196keys
197len
198new
199new_in
200par_drain
201par_eq
202par_keys
203par_values
204par_values_mut
205raw_entry
206raw_entry_mut
207remove
208remove_entry
209reserve
210retain
211shrink_to
212shrink_to_fit
213try_insert
214try_reserve
215values
216values_mut
217with_capacity
218with_capacity_and_hasher
219with_capacity_and_hasher_in
220with_capacity_in
221with_hasher
222with_hasher_in
223Trait Implementations
224Clone
225Debug
226Default
227Deserialize<'de>
228Eq
229Extend<&'a (K, V)>
230Extend<(&'a K, &'a V)>
231Extend<(K, V)>
232From<HashMap<T, (), S, A>>
233From<[(K, V); N]>
234FromIterator<(K, V)>
235FromParallelIterator<(K, V)>
236Index<&Q>
237IntoIterator
238IntoIterator
239IntoIterator
240IntoParallelIterator
241IntoParallelIterator
242IntoParallelIterator
243ParallelExtend<(&'a K, &'a V)>
244ParallelExtend<(K, V)>
245PartialEq
246Serialize
247
248*/