isnt/std_1/
collections.rs

1// This file was generated
2
3mod b_tree_map_private { pub trait Sealed<K, V> { } }
4
5/// Extension for [`BTreeMap`](std::collections::BTreeMap)
6pub trait IsntBTreeMapExt<K, V>: b_tree_map_private::Sealed<K, V> {
7    /// The negation of [`is_empty`](std::collections::BTreeMap::is_empty)
8    #[must_use]
9    fn is_not_empty(&self) -> bool;
10    /// The negation of [`contains_key`](std::collections::BTreeMap::contains_key)
11    #[must_use]
12    fn not_contains_key<Q>(&self, key: &Q) -> bool where K: std::borrow::Borrow<Q> + Ord, Q: Ord + ?Sized,;
13}
14
15impl<K, V> b_tree_map_private::Sealed<K, V> for std::collections::BTreeMap<K, V> { }
16
17impl<K, V> IsntBTreeMapExt<K, V> for std::collections::BTreeMap<K, V> {
18    #[inline]
19    fn is_not_empty(&self) -> bool {
20        !self.is_empty()
21    }
22
23    #[inline]
24    fn not_contains_key<Q>(&self, key: &Q) -> bool where K: std::borrow::Borrow<Q> + Ord, Q: Ord + ?Sized, {
25        !self.contains_key::<Q>(key)
26    }
27}
28
29mod b_tree_set_private { pub trait Sealed<T> { } }
30
31/// Extension for [`BTreeSet`](std::collections::BTreeSet)
32pub trait IsntBTreeSetExt<T>: b_tree_set_private::Sealed<T> {
33    /// The negation of [`contains`](std::collections::BTreeSet::contains)
34    #[must_use]
35    fn not_contains<Q>(&self, value: &Q) -> bool where T: std::borrow::Borrow<Q> + Ord, Q: Ord + ?Sized;
36    /// The negation of [`is_disjoint`](std::collections::BTreeSet::is_disjoint)
37    #[must_use]
38    fn is_not_disjoint(&self, other: &std::collections::BTreeSet<T>) -> bool where T: Ord;
39    /// The negation of [`is_subset`](std::collections::BTreeSet::is_subset)
40    #[must_use]
41    fn is_not_subset(&self, other: &std::collections::BTreeSet<T>) -> bool where T: Ord;
42    /// The negation of [`is_superset`](std::collections::BTreeSet::is_superset)
43    #[must_use]
44    fn is_not_superset(&self, other: &std::collections::BTreeSet<T>) -> bool where T: Ord;
45    /// The negation of [`insert`](std::collections::BTreeSet::insert)
46    #[must_use]
47    fn not_insert(&mut self, value: T) -> bool where T: Ord;
48    /// The negation of [`remove`](std::collections::BTreeSet::remove)
49    #[must_use]
50    fn not_remove<Q>(&mut self, value: &Q) -> bool where T: std::borrow::Borrow<Q> + Ord, Q: Ord + ?Sized;
51    /// The negation of [`is_empty`](std::collections::BTreeSet::is_empty)
52    #[must_use]
53    fn is_not_empty(&self) -> bool;
54}
55
56impl<T> b_tree_set_private::Sealed<T> for std::collections::BTreeSet<T> { }
57
58impl<T> IsntBTreeSetExt<T> for std::collections::BTreeSet<T> {
59    #[inline]
60    fn not_contains<Q>(&self, value: &Q) -> bool where T: std::borrow::Borrow<Q> + Ord, Q: Ord + ?Sized {
61        !self.contains::<Q>(value)
62    }
63
64    #[inline]
65    fn is_not_disjoint(&self, other: &std::collections::BTreeSet<T>) -> bool where T: Ord {
66        !self.is_disjoint(other)
67    }
68
69    #[inline]
70    fn is_not_subset(&self, other: &std::collections::BTreeSet<T>) -> bool where T: Ord {
71        !self.is_subset(other)
72    }
73
74    #[inline]
75    fn is_not_superset(&self, other: &std::collections::BTreeSet<T>) -> bool where T: Ord {
76        !self.is_superset(other)
77    }
78
79    #[inline]
80    fn not_insert(&mut self, value: T) -> bool where T: Ord {
81        !self.insert(value)
82    }
83
84    #[inline]
85    fn not_remove<Q>(&mut self, value: &Q) -> bool where T: std::borrow::Borrow<Q> + Ord, Q: Ord + ?Sized {
86        !self.remove::<Q>(value)
87    }
88
89    #[inline]
90    fn is_not_empty(&self) -> bool {
91        !self.is_empty()
92    }
93}
94
95mod binary_heap_private { pub trait Sealed<T> { } }
96
97/// Extension for [`BinaryHeap`](std::collections::BinaryHeap)
98pub trait IsntBinaryHeapExt<T>: binary_heap_private::Sealed<T> {
99    /// The negation of [`is_empty`](std::collections::BinaryHeap::is_empty)
100    #[must_use]
101    fn is_not_empty(&self) -> bool;
102}
103
104impl<T> binary_heap_private::Sealed<T> for std::collections::BinaryHeap<T> { }
105
106impl<T> IsntBinaryHeapExt<T> for std::collections::BinaryHeap<T> {
107    #[inline]
108    fn is_not_empty(&self) -> bool {
109        !self.is_empty()
110    }
111}
112
113mod hash_map_private { pub trait Sealed<K, V, S> { } }
114
115/// Extension for [`HashMap`](std::collections::HashMap)
116pub trait IsntHashMapExt<K, V, S>: hash_map_private::Sealed<K, V, S> {
117    /// The negation of [`is_empty`](std::collections::HashMap::is_empty)
118    #[must_use]
119    fn is_not_empty(&self) -> bool;
120    /// The negation of [`contains_key`](std::collections::HashMap::contains_key)
121    #[must_use]
122    fn not_contains_key<Q>(&self, k: &Q) -> bool where K: std::borrow::Borrow<Q> + std::hash::Hash + Eq, Q: std::hash::Hash + Eq + ?Sized, S: std::hash::BuildHasher;
123}
124
125impl<K, V, S> hash_map_private::Sealed<K, V, S> for std::collections::HashMap<K, V, S> { }
126
127impl<K, V, S> IsntHashMapExt<K, V, S> for std::collections::HashMap<K, V, S> {
128    #[inline]
129    fn is_not_empty(&self) -> bool {
130        !self.is_empty()
131    }
132
133    #[inline]
134    fn not_contains_key<Q>(&self, k: &Q) -> bool where K: std::borrow::Borrow<Q> + std::hash::Hash + Eq, Q: std::hash::Hash + Eq + ?Sized, S: std::hash::BuildHasher {
135        !self.contains_key::<Q>(k)
136    }
137}
138
139mod hash_set_private { pub trait Sealed<T, S> { } }
140
141/// Extension for [`HashSet`](std::collections::HashSet)
142pub trait IsntHashSetExt<T, S>: hash_set_private::Sealed<T, S> {
143    /// The negation of [`is_empty`](std::collections::HashSet::is_empty)
144    #[must_use]
145    fn is_not_empty(&self) -> bool;
146    /// The negation of [`contains`](std::collections::HashSet::contains)
147    #[must_use]
148    fn not_contains<Q>(&self, value: &Q) -> bool where T: std::borrow::Borrow<Q> + std::hash::Hash + Eq, Q: std::hash::Hash + Eq + ?Sized, S: std::hash::BuildHasher;
149    /// The negation of [`is_disjoint`](std::collections::HashSet::is_disjoint)
150    #[must_use]
151    fn is_not_disjoint(&self, other: &std::collections::HashSet<T, S>) -> bool where T: std::hash::Hash + Eq, S: std::hash::BuildHasher;
152    /// The negation of [`is_subset`](std::collections::HashSet::is_subset)
153    #[must_use]
154    fn is_not_subset(&self, other: &std::collections::HashSet<T, S>) -> bool where T: std::hash::Hash + Eq, S: std::hash::BuildHasher;
155    /// The negation of [`is_superset`](std::collections::HashSet::is_superset)
156    #[must_use]
157    fn is_not_superset(&self, other: &std::collections::HashSet<T, S>) -> bool where T: std::hash::Hash + Eq, S: std::hash::BuildHasher;
158    /// The negation of [`insert`](std::collections::HashSet::insert)
159    #[must_use]
160    fn not_insert(&mut self, value: T) -> bool where T: std::hash::Hash + Eq, S: std::hash::BuildHasher;
161    /// The negation of [`remove`](std::collections::HashSet::remove)
162    #[must_use]
163    fn not_remove<Q>(&mut self, value: &Q) -> bool where T: std::borrow::Borrow<Q> + std::hash::Hash + Eq, Q: std::hash::Hash + Eq + ?Sized, S: std::hash::BuildHasher;
164}
165
166impl<T, S> hash_set_private::Sealed<T, S> for std::collections::HashSet<T, S> { }
167
168impl<T, S> IsntHashSetExt<T, S> for std::collections::HashSet<T, S> {
169    #[inline]
170    fn is_not_empty(&self) -> bool {
171        !self.is_empty()
172    }
173
174    #[inline]
175    fn not_contains<Q>(&self, value: &Q) -> bool where T: std::borrow::Borrow<Q> + std::hash::Hash + Eq, Q: std::hash::Hash + Eq + ?Sized, S: std::hash::BuildHasher {
176        !self.contains::<Q>(value)
177    }
178
179    #[inline]
180    fn is_not_disjoint(&self, other: &std::collections::HashSet<T, S>) -> bool where T: std::hash::Hash + Eq, S: std::hash::BuildHasher {
181        !self.is_disjoint(other)
182    }
183
184    #[inline]
185    fn is_not_subset(&self, other: &std::collections::HashSet<T, S>) -> bool where T: std::hash::Hash + Eq, S: std::hash::BuildHasher {
186        !self.is_subset(other)
187    }
188
189    #[inline]
190    fn is_not_superset(&self, other: &std::collections::HashSet<T, S>) -> bool where T: std::hash::Hash + Eq, S: std::hash::BuildHasher {
191        !self.is_superset(other)
192    }
193
194    #[inline]
195    fn not_insert(&mut self, value: T) -> bool where T: std::hash::Hash + Eq, S: std::hash::BuildHasher {
196        !self.insert(value)
197    }
198
199    #[inline]
200    fn not_remove<Q>(&mut self, value: &Q) -> bool where T: std::borrow::Borrow<Q> + std::hash::Hash + Eq, Q: std::hash::Hash + Eq + ?Sized, S: std::hash::BuildHasher {
201        !self.remove::<Q>(value)
202    }
203}
204
205mod linked_list_private { pub trait Sealed<T> { } }
206
207/// Extension for [`LinkedList`](std::collections::LinkedList)
208pub trait IsntLinkedListExt<T>: linked_list_private::Sealed<T> {
209    /// The negation of [`is_empty`](std::collections::LinkedList::is_empty)
210    #[must_use]
211    fn is_not_empty(&self) -> bool;
212    /// The negation of [`contains`](std::collections::LinkedList::contains)
213    #[must_use]
214    fn not_contains(&self, x: &T) -> bool where T: PartialEq;
215}
216
217impl<T> linked_list_private::Sealed<T> for std::collections::LinkedList<T> { }
218
219impl<T> IsntLinkedListExt<T> for std::collections::LinkedList<T> {
220    #[inline]
221    fn is_not_empty(&self) -> bool {
222        !self.is_empty()
223    }
224
225    #[inline]
226    fn not_contains(&self, x: &T) -> bool where T: PartialEq {
227        !self.contains(x)
228    }
229}
230
231mod vec_deque_private { pub trait Sealed<T> { } }
232
233/// Extension for [`VecDeque`](std::collections::VecDeque)
234pub trait IsntVecDequeExt<T>: vec_deque_private::Sealed<T> {
235    /// The negation of [`is_empty`](std::collections::VecDeque::is_empty)
236    #[must_use]
237    fn is_not_empty(&self) -> bool;
238    /// The negation of [`contains`](std::collections::VecDeque::contains)
239    #[must_use]
240    fn not_contains(&self, x: &T) -> bool where T: PartialEq<T>,;
241}
242
243impl<T> vec_deque_private::Sealed<T> for std::collections::VecDeque<T> { }
244
245impl<T> IsntVecDequeExt<T> for std::collections::VecDeque<T> {
246    #[inline]
247    fn is_not_empty(&self) -> bool {
248        !self.is_empty()
249    }
250
251    #[inline]
252    fn not_contains(&self, x: &T) -> bool where T: PartialEq<T>, {
253        !self.contains(x)
254    }
255}