1use crate::std::iter::Iterator;
27
28pub trait IsEmptyProperty {
33 fn is_empty_property(&self) -> bool;
35}
36
37impl<T> IsEmptyProperty for &T
38where
39 T: IsEmptyProperty + ?Sized,
40{
41 fn is_empty_property(&self) -> bool {
42 <T as IsEmptyProperty>::is_empty_property(self)
43 }
44}
45
46impl<T> IsEmptyProperty for &mut T
47where
48 T: IsEmptyProperty + ?Sized,
49{
50 fn is_empty_property(&self) -> bool {
51 <T as IsEmptyProperty>::is_empty_property(self)
52 }
53}
54
55pub trait LengthProperty {
63 fn length_property(&self) -> usize;
65}
66
67impl<T> LengthProperty for &T
68where
69 T: LengthProperty + ?Sized,
70{
71 fn length_property(&self) -> usize {
72 <T as LengthProperty>::length_property(self)
73 }
74}
75
76impl<T> LengthProperty for &mut T
77where
78 T: LengthProperty + ?Sized,
79{
80 fn length_property(&self) -> usize {
81 <T as LengthProperty>::length_property(self)
82 }
83}
84
85pub trait DefinedOrderProperty {}
88
89impl<C> DefinedOrderProperty for &C where C: DefinedOrderProperty + ?Sized {}
90impl<C> DefinedOrderProperty for &mut C where C: DefinedOrderProperty + ?Sized {}
91
92pub trait CharCountProperty {
94 fn char_count_property(&self) -> usize;
96}
97
98impl<T> CharCountProperty for &T
99where
100 T: CharCountProperty + ?Sized,
101{
102 fn char_count_property(&self) -> usize {
103 <T as CharCountProperty>::char_count_property(self)
104 }
105}
106
107impl<T> CharCountProperty for &mut T
108where
109 T: CharCountProperty + ?Sized,
110{
111 fn char_count_property(&self) -> usize {
112 <T as CharCountProperty>::char_count_property(self)
113 }
114}
115
116pub trait AdditiveIdentityProperty {
118 fn additive_identity() -> Self;
120}
121
122pub trait MultiplicativeIdentityProperty {
124 fn multiplicative_identity() -> Self;
126}
127
128pub trait SignumProperty {
130 fn is_negative_property(&self) -> bool;
132
133 fn is_positive_property(&self) -> bool;
135}
136
137impl<T> SignumProperty for &T
138where
139 T: SignumProperty + ?Sized,
140{
141 fn is_negative_property(&self) -> bool {
142 <T as SignumProperty>::is_negative_property(self)
143 }
144
145 fn is_positive_property(&self) -> bool {
146 <T as SignumProperty>::is_positive_property(self)
147 }
148}
149
150impl<T> SignumProperty for &mut T
151where
152 T: SignumProperty + ?Sized,
153{
154 fn is_negative_property(&self) -> bool {
155 <T as SignumProperty>::is_negative_property(self)
156 }
157
158 fn is_positive_property(&self) -> bool {
159 <T as SignumProperty>::is_positive_property(self)
160 }
161}
162
163pub trait InfinityProperty {
166 fn is_infinite_property(&self) -> bool;
168
169 fn is_finite_property(&self) -> bool;
171}
172
173impl<T> InfinityProperty for &T
174where
175 T: InfinityProperty + ?Sized,
176{
177 fn is_infinite_property(&self) -> bool {
178 <T as InfinityProperty>::is_infinite_property(self)
179 }
180
181 fn is_finite_property(&self) -> bool {
182 <T as InfinityProperty>::is_finite_property(self)
183 }
184}
185
186impl<T> InfinityProperty for &mut T
187where
188 T: InfinityProperty + ?Sized,
189{
190 fn is_infinite_property(&self) -> bool {
191 <T as InfinityProperty>::is_infinite_property(self)
192 }
193
194 fn is_finite_property(&self) -> bool {
195 <T as InfinityProperty>::is_finite_property(self)
196 }
197}
198
199pub trait IsNanProperty {
201 fn is_nan_property(&self) -> bool;
203}
204
205impl<T> IsNanProperty for &T
206where
207 T: IsNanProperty + ?Sized,
208{
209 fn is_nan_property(&self) -> bool {
210 <T as IsNanProperty>::is_nan_property(self)
211 }
212}
213
214impl<T> IsNanProperty for &mut T
215where
216 T: IsNanProperty + ?Sized,
217{
218 fn is_nan_property(&self) -> bool {
219 <T as IsNanProperty>::is_nan_property(self)
220 }
221}
222
223pub trait DecimalProperties {
225 fn precision_property(&self) -> u64;
230
231 fn scale_property(&self) -> i64;
233
234 fn is_integer_property(&self) -> bool;
237}
238
239impl<T> DecimalProperties for &T
240where
241 T: DecimalProperties + ?Sized,
242{
243 fn precision_property(&self) -> u64 {
244 <T as DecimalProperties>::precision_property(self)
245 }
246
247 fn scale_property(&self) -> i64 {
248 <T as DecimalProperties>::scale_property(self)
249 }
250
251 fn is_integer_property(&self) -> bool {
252 <T as DecimalProperties>::is_integer_property(self)
253 }
254}
255
256impl<T> DecimalProperties for &mut T
257where
258 T: DecimalProperties + ?Sized,
259{
260 fn precision_property(&self) -> u64 {
261 <T as DecimalProperties>::precision_property(self)
262 }
263
264 fn scale_property(&self) -> i64 {
265 <T as DecimalProperties>::scale_property(self)
266 }
267
268 fn is_integer_property(&self) -> bool {
269 <T as DecimalProperties>::is_integer_property(self)
270 }
271}
272
273pub trait MapProperties {
275 type Key;
277
278 type Value;
280
281 fn keys_property(&self) -> impl Iterator<Item = &Self::Key>;
283
284 fn values_property(&self) -> impl Iterator<Item = &Self::Value>;
286
287 fn entries_property(&self) -> impl Iterator<Item = (&Self::Key, &Self::Value)>;
289}