glam/usize/
usizevec2.rs

1// Generated from vec.rs.tera template. Edit the template, not the generated file.
2
3use crate::{BVec2, I16Vec2, I64Vec2, I8Vec2, IVec2, U16Vec2, U64Vec2, U8Vec2, USizeVec3, UVec2};
4
5use core::fmt;
6use core::iter::{Product, Sum};
7use core::{f32, ops::*};
8
9/// Creates a 2-dimensional vector.
10#[inline(always)]
11#[must_use]
12pub const fn usizevec2(x: usize, y: usize) -> USizeVec2 {
13    USizeVec2::new(x, y)
14}
15
16/// A 2-dimensional vector.
17#[cfg_attr(not(target_arch = "spirv"), derive(Hash))]
18#[derive(Clone, Copy, PartialEq, Eq)]
19#[cfg_attr(
20    all(feature = "bytemuck", not(target_arch = "spirv")),
21    derive(bytemuck::Pod, bytemuck::Zeroable)
22)]
23#[cfg_attr(feature = "cuda", repr(align(16)))]
24#[cfg_attr(not(target_arch = "spirv"), repr(C))]
25#[cfg_attr(target_arch = "spirv", repr(simd))]
26pub struct USizeVec2 {
27    pub x: usize,
28    pub y: usize,
29}
30
31impl USizeVec2 {
32    /// All zeroes.
33    pub const ZERO: Self = Self::splat(0);
34
35    /// All ones.
36    pub const ONE: Self = Self::splat(1);
37
38    /// All `usize::MIN`.
39    pub const MIN: Self = Self::splat(usize::MIN);
40
41    /// All `usize::MAX`.
42    pub const MAX: Self = Self::splat(usize::MAX);
43
44    /// A unit vector pointing along the positive X axis.
45    pub const X: Self = Self::new(1, 0);
46
47    /// A unit vector pointing along the positive Y axis.
48    pub const Y: Self = Self::new(0, 1);
49
50    /// The unit axes.
51    pub const AXES: [Self; 2] = [Self::X, Self::Y];
52
53    /// Creates a new vector.
54    #[inline(always)]
55    #[must_use]
56    pub const fn new(x: usize, y: usize) -> Self {
57        Self { x, y }
58    }
59
60    /// Creates a vector with all elements set to `v`.
61    #[inline]
62    #[must_use]
63    pub const fn splat(v: usize) -> Self {
64        Self { x: v, y: v }
65    }
66
67    /// Returns a vector containing each element of `self` modified by a mapping function `f`.
68    #[inline]
69    #[must_use]
70    pub fn map<F>(self, f: F) -> Self
71    where
72        F: Fn(usize) -> usize,
73    {
74        Self::new(f(self.x), f(self.y))
75    }
76
77    /// Creates a vector from the elements in `if_true` and `if_false`, selecting which to use
78    /// for each element of `self`.
79    ///
80    /// A true element in the mask uses the corresponding element from `if_true`, and false
81    /// uses the element from `if_false`.
82    #[inline]
83    #[must_use]
84    pub fn select(mask: BVec2, if_true: Self, if_false: Self) -> Self {
85        Self {
86            x: if mask.test(0) { if_true.x } else { if_false.x },
87            y: if mask.test(1) { if_true.y } else { if_false.y },
88        }
89    }
90
91    /// Creates a new vector from an array.
92    #[inline]
93    #[must_use]
94    pub const fn from_array(a: [usize; 2]) -> Self {
95        Self::new(a[0], a[1])
96    }
97
98    /// Converts `self` to `[x, y]`
99    #[inline]
100    #[must_use]
101    pub const fn to_array(&self) -> [usize; 2] {
102        [self.x, self.y]
103    }
104
105    /// Creates a vector from the first 2 values in `slice`.
106    ///
107    /// # Panics
108    ///
109    /// Panics if `slice` is less than 2 elements long.
110    #[inline]
111    #[must_use]
112    pub const fn from_slice(slice: &[usize]) -> Self {
113        assert!(slice.len() >= 2);
114        Self::new(slice[0], slice[1])
115    }
116
117    /// Writes the elements of `self` to the first 2 elements in `slice`.
118    ///
119    /// # Panics
120    ///
121    /// Panics if `slice` is less than 2 elements long.
122    #[inline]
123    pub fn write_to_slice(self, slice: &mut [usize]) {
124        slice[..2].copy_from_slice(&self.to_array());
125    }
126
127    /// Creates a 3D vector from `self` and the given `z` value.
128    #[inline]
129    #[must_use]
130    pub const fn extend(self, z: usize) -> USizeVec3 {
131        USizeVec3::new(self.x, self.y, z)
132    }
133
134    /// Creates a 2D vector from `self` with the given value of `x`.
135    #[inline]
136    #[must_use]
137    pub fn with_x(mut self, x: usize) -> Self {
138        self.x = x;
139        self
140    }
141
142    /// Creates a 2D vector from `self` with the given value of `y`.
143    #[inline]
144    #[must_use]
145    pub fn with_y(mut self, y: usize) -> Self {
146        self.y = y;
147        self
148    }
149
150    /// Computes the dot product of `self` and `rhs`.
151    #[inline]
152    #[must_use]
153    pub fn dot(self, rhs: Self) -> usize {
154        (self.x * rhs.x) + (self.y * rhs.y)
155    }
156
157    /// Returns a vector where every component is the dot product of `self` and `rhs`.
158    #[inline]
159    #[must_use]
160    pub fn dot_into_vec(self, rhs: Self) -> Self {
161        Self::splat(self.dot(rhs))
162    }
163
164    /// Returns a vector containing the minimum values for each element of `self` and `rhs`.
165    ///
166    /// In other words this computes `[min(x, rhs.x), min(self.y, rhs.y), ..]`.
167    #[inline]
168    #[must_use]
169    pub fn min(self, rhs: Self) -> Self {
170        Self {
171            x: if self.x < rhs.x { self.x } else { rhs.x },
172            y: if self.y < rhs.y { self.y } else { rhs.y },
173        }
174    }
175
176    /// Returns a vector containing the maximum values for each element of `self` and `rhs`.
177    ///
178    /// In other words this computes `[max(self.x, rhs.x), max(self.y, rhs.y), ..]`.
179    #[inline]
180    #[must_use]
181    pub fn max(self, rhs: Self) -> Self {
182        Self {
183            x: if self.x > rhs.x { self.x } else { rhs.x },
184            y: if self.y > rhs.y { self.y } else { rhs.y },
185        }
186    }
187
188    /// Component-wise clamping of values, similar to [`usize::clamp`].
189    ///
190    /// Each element in `min` must be less-or-equal to the corresponding element in `max`.
191    ///
192    /// # Panics
193    ///
194    /// Will panic if `min` is greater than `max` when `glam_assert` is enabled.
195    #[inline]
196    #[must_use]
197    pub fn clamp(self, min: Self, max: Self) -> Self {
198        glam_assert!(min.cmple(max).all(), "clamp: expected min <= max");
199        self.max(min).min(max)
200    }
201
202    /// Returns the horizontal minimum of `self`.
203    ///
204    /// In other words this computes `min(x, y, ..)`.
205    #[inline]
206    #[must_use]
207    pub fn min_element(self) -> usize {
208        let min = |a, b| if a < b { a } else { b };
209        min(self.x, self.y)
210    }
211
212    /// Returns the horizontal maximum of `self`.
213    ///
214    /// In other words this computes `max(x, y, ..)`.
215    #[inline]
216    #[must_use]
217    pub fn max_element(self) -> usize {
218        let max = |a, b| if a > b { a } else { b };
219        max(self.x, self.y)
220    }
221
222    /// Returns the index of the first minimum element of `self`.
223    #[doc(alias = "argmin")]
224    #[inline]
225    #[must_use]
226    pub fn min_position(self) -> usize {
227        if self.x <= self.y {
228            0
229        } else {
230            1
231        }
232    }
233
234    /// Returns the index of the first maximum element of `self`.
235    #[doc(alias = "argmax")]
236    #[inline]
237    #[must_use]
238    pub fn max_position(self) -> usize {
239        if self.x >= self.y {
240            0
241        } else {
242            1
243        }
244    }
245
246    /// Returns the sum of all elements of `self`.
247    ///
248    /// In other words, this computes `self.x + self.y + ..`.
249    #[inline]
250    #[must_use]
251    pub fn element_sum(self) -> usize {
252        self.x + self.y
253    }
254
255    /// Returns the product of all elements of `self`.
256    ///
257    /// In other words, this computes `self.x * self.y * ..`.
258    #[inline]
259    #[must_use]
260    pub fn element_product(self) -> usize {
261        self.x * self.y
262    }
263
264    /// Returns a vector mask containing the result of a `==` comparison for each element of
265    /// `self` and `rhs`.
266    ///
267    /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all
268    /// elements.
269    #[inline]
270    #[must_use]
271    pub fn cmpeq(self, rhs: Self) -> BVec2 {
272        BVec2::new(self.x.eq(&rhs.x), self.y.eq(&rhs.y))
273    }
274
275    /// Returns a vector mask containing the result of a `!=` comparison for each element of
276    /// `self` and `rhs`.
277    ///
278    /// In other words this computes `[self.x != rhs.x, self.y != rhs.y, ..]` for all
279    /// elements.
280    #[inline]
281    #[must_use]
282    pub fn cmpne(self, rhs: Self) -> BVec2 {
283        BVec2::new(self.x.ne(&rhs.x), self.y.ne(&rhs.y))
284    }
285
286    /// Returns a vector mask containing the result of a `>=` comparison for each element of
287    /// `self` and `rhs`.
288    ///
289    /// In other words this computes `[self.x >= rhs.x, self.y >= rhs.y, ..]` for all
290    /// elements.
291    #[inline]
292    #[must_use]
293    pub fn cmpge(self, rhs: Self) -> BVec2 {
294        BVec2::new(self.x.ge(&rhs.x), self.y.ge(&rhs.y))
295    }
296
297    /// Returns a vector mask containing the result of a `>` comparison for each element of
298    /// `self` and `rhs`.
299    ///
300    /// In other words this computes `[self.x > rhs.x, self.y > rhs.y, ..]` for all
301    /// elements.
302    #[inline]
303    #[must_use]
304    pub fn cmpgt(self, rhs: Self) -> BVec2 {
305        BVec2::new(self.x.gt(&rhs.x), self.y.gt(&rhs.y))
306    }
307
308    /// Returns a vector mask containing the result of a `<=` comparison for each element of
309    /// `self` and `rhs`.
310    ///
311    /// In other words this computes `[self.x <= rhs.x, self.y <= rhs.y, ..]` for all
312    /// elements.
313    #[inline]
314    #[must_use]
315    pub fn cmple(self, rhs: Self) -> BVec2 {
316        BVec2::new(self.x.le(&rhs.x), self.y.le(&rhs.y))
317    }
318
319    /// Returns a vector mask containing the result of a `<` comparison for each element of
320    /// `self` and `rhs`.
321    ///
322    /// In other words this computes `[self.x < rhs.x, self.y < rhs.y, ..]` for all
323    /// elements.
324    #[inline]
325    #[must_use]
326    pub fn cmplt(self, rhs: Self) -> BVec2 {
327        BVec2::new(self.x.lt(&rhs.x), self.y.lt(&rhs.y))
328    }
329
330    /// Computes the squared length of `self`.
331    #[doc(alias = "magnitude2")]
332    #[inline]
333    #[must_use]
334    pub fn length_squared(self) -> usize {
335        self.dot(self)
336    }
337
338    /// Computes the [manhattan distance] between two points.
339    ///
340    /// # Overflow
341    /// This method may overflow if the result is greater than [`usize::MAX`].
342    ///
343    /// See also [`checked_manhattan_distance`][USizeVec2::checked_manhattan_distance].
344    ///
345    /// [manhattan distance]: https://en.wikipedia.org/wiki/Taxicab_geometry
346    #[inline]
347    #[must_use]
348    pub fn manhattan_distance(self, rhs: Self) -> usize {
349        self.x.abs_diff(rhs.x) + self.y.abs_diff(rhs.y)
350    }
351
352    /// Computes the [manhattan distance] between two points.
353    ///
354    /// This will returns [`None`] if the result is greater than [`usize::MAX`].
355    ///
356    /// [manhattan distance]: https://en.wikipedia.org/wiki/Taxicab_geometry
357    #[inline]
358    #[must_use]
359    pub fn checked_manhattan_distance(self, rhs: Self) -> Option<usize> {
360        let d = self.x.abs_diff(rhs.x);
361        d.checked_add(self.y.abs_diff(rhs.y))
362    }
363
364    /// Computes the [chebyshev distance] between two points.
365    ///
366    /// [chebyshev distance]: https://en.wikipedia.org/wiki/Chebyshev_distance
367    #[inline]
368    #[must_use]
369    pub fn chebyshev_distance(self, rhs: Self) -> usize {
370        // Note: the compiler will eventually optimize out the loop
371        [self.x.abs_diff(rhs.x), self.y.abs_diff(rhs.y)]
372            .into_iter()
373            .max()
374            .unwrap()
375    }
376
377    /// Casts all elements of `self` to `f32`.
378    #[inline]
379    #[must_use]
380    pub fn as_vec2(&self) -> crate::Vec2 {
381        crate::Vec2::new(self.x as f32, self.y as f32)
382    }
383
384    /// Casts all elements of `self` to `f64`.
385    #[inline]
386    #[must_use]
387    pub fn as_dvec2(&self) -> crate::DVec2 {
388        crate::DVec2::new(self.x as f64, self.y as f64)
389    }
390
391    /// Casts all elements of `self` to `i8`.
392    #[inline]
393    #[must_use]
394    pub fn as_i8vec2(&self) -> crate::I8Vec2 {
395        crate::I8Vec2::new(self.x as i8, self.y as i8)
396    }
397
398    /// Casts all elements of `self` to `u8`.
399    #[inline]
400    #[must_use]
401    pub fn as_u8vec2(&self) -> crate::U8Vec2 {
402        crate::U8Vec2::new(self.x as u8, self.y as u8)
403    }
404
405    /// Casts all elements of `self` to `i16`.
406    #[inline]
407    #[must_use]
408    pub fn as_i16vec2(&self) -> crate::I16Vec2 {
409        crate::I16Vec2::new(self.x as i16, self.y as i16)
410    }
411
412    /// Casts all elements of `self` to `u16`.
413    #[inline]
414    #[must_use]
415    pub fn as_u16vec2(&self) -> crate::U16Vec2 {
416        crate::U16Vec2::new(self.x as u16, self.y as u16)
417    }
418
419    /// Casts all elements of `self` to `i32`.
420    #[inline]
421    #[must_use]
422    pub fn as_ivec2(&self) -> crate::IVec2 {
423        crate::IVec2::new(self.x as i32, self.y as i32)
424    }
425
426    /// Casts all elements of `self` to `u32`.
427    #[inline]
428    #[must_use]
429    pub fn as_uvec2(&self) -> crate::UVec2 {
430        crate::UVec2::new(self.x as u32, self.y as u32)
431    }
432
433    /// Casts all elements of `self` to `i64`.
434    #[inline]
435    #[must_use]
436    pub fn as_i64vec2(&self) -> crate::I64Vec2 {
437        crate::I64Vec2::new(self.x as i64, self.y as i64)
438    }
439
440    /// Casts all elements of `self` to `u64`.
441    #[inline]
442    #[must_use]
443    pub fn as_u64vec2(&self) -> crate::U64Vec2 {
444        crate::U64Vec2::new(self.x as u64, self.y as u64)
445    }
446
447    /// Returns a vector containing the wrapping addition of `self` and `rhs`.
448    ///
449    /// In other words this computes `Some([self.x + rhs.x, self.y + rhs.y, ..])` but returns `None` on any overflow.
450    #[inline]
451    #[must_use]
452    pub const fn checked_add(self, rhs: Self) -> Option<Self> {
453        let x = match self.x.checked_add(rhs.x) {
454            Some(v) => v,
455            None => return None,
456        };
457        let y = match self.y.checked_add(rhs.y) {
458            Some(v) => v,
459            None => return None,
460        };
461
462        Some(Self { x, y })
463    }
464
465    /// Returns a vector containing the wrapping subtraction of `self` and `rhs`.
466    ///
467    /// In other words this computes `Some([self.x - rhs.x, self.y - rhs.y, ..])` but returns `None` on any overflow.
468    #[inline]
469    #[must_use]
470    pub const fn checked_sub(self, rhs: Self) -> Option<Self> {
471        let x = match self.x.checked_sub(rhs.x) {
472            Some(v) => v,
473            None => return None,
474        };
475        let y = match self.y.checked_sub(rhs.y) {
476            Some(v) => v,
477            None => return None,
478        };
479
480        Some(Self { x, y })
481    }
482
483    /// Returns a vector containing the wrapping multiplication of `self` and `rhs`.
484    ///
485    /// In other words this computes `Some([self.x * rhs.x, self.y * rhs.y, ..])` but returns `None` on any overflow.
486    #[inline]
487    #[must_use]
488    pub const fn checked_mul(self, rhs: Self) -> Option<Self> {
489        let x = match self.x.checked_mul(rhs.x) {
490            Some(v) => v,
491            None => return None,
492        };
493        let y = match self.y.checked_mul(rhs.y) {
494            Some(v) => v,
495            None => return None,
496        };
497
498        Some(Self { x, y })
499    }
500
501    /// Returns a vector containing the wrapping division of `self` and `rhs`.
502    ///
503    /// In other words this computes `Some([self.x / rhs.x, self.y / rhs.y, ..])` but returns `None` on any division by zero.
504    #[inline]
505    #[must_use]
506    pub const fn checked_div(self, rhs: Self) -> Option<Self> {
507        let x = match self.x.checked_div(rhs.x) {
508            Some(v) => v,
509            None => return None,
510        };
511        let y = match self.y.checked_div(rhs.y) {
512            Some(v) => v,
513            None => return None,
514        };
515
516        Some(Self { x, y })
517    }
518
519    /// Returns a vector containing the wrapping addition of `self` and `rhs`.
520    ///
521    /// In other words this computes `[self.x.wrapping_add(rhs.x), self.y.wrapping_add(rhs.y), ..]`.
522    #[inline]
523    #[must_use]
524    pub const fn wrapping_add(self, rhs: Self) -> Self {
525        Self {
526            x: self.x.wrapping_add(rhs.x),
527            y: self.y.wrapping_add(rhs.y),
528        }
529    }
530
531    /// Returns a vector containing the wrapping subtraction of `self` and `rhs`.
532    ///
533    /// In other words this computes `[self.x.wrapping_sub(rhs.x), self.y.wrapping_sub(rhs.y), ..]`.
534    #[inline]
535    #[must_use]
536    pub const fn wrapping_sub(self, rhs: Self) -> Self {
537        Self {
538            x: self.x.wrapping_sub(rhs.x),
539            y: self.y.wrapping_sub(rhs.y),
540        }
541    }
542
543    /// Returns a vector containing the wrapping multiplication of `self` and `rhs`.
544    ///
545    /// In other words this computes `[self.x.wrapping_mul(rhs.x), self.y.wrapping_mul(rhs.y), ..]`.
546    #[inline]
547    #[must_use]
548    pub const fn wrapping_mul(self, rhs: Self) -> Self {
549        Self {
550            x: self.x.wrapping_mul(rhs.x),
551            y: self.y.wrapping_mul(rhs.y),
552        }
553    }
554
555    /// Returns a vector containing the wrapping division of `self` and `rhs`.
556    ///
557    /// In other words this computes `[self.x.wrapping_div(rhs.x), self.y.wrapping_div(rhs.y), ..]`.
558    #[inline]
559    #[must_use]
560    pub const fn wrapping_div(self, rhs: Self) -> Self {
561        Self {
562            x: self.x.wrapping_div(rhs.x),
563            y: self.y.wrapping_div(rhs.y),
564        }
565    }
566
567    /// Returns a vector containing the saturating addition of `self` and `rhs`.
568    ///
569    /// In other words this computes `[self.x.saturating_add(rhs.x), self.y.saturating_add(rhs.y), ..]`.
570    #[inline]
571    #[must_use]
572    pub const fn saturating_add(self, rhs: Self) -> Self {
573        Self {
574            x: self.x.saturating_add(rhs.x),
575            y: self.y.saturating_add(rhs.y),
576        }
577    }
578
579    /// Returns a vector containing the saturating subtraction of `self` and `rhs`.
580    ///
581    /// In other words this computes `[self.x.saturating_sub(rhs.x), self.y.saturating_sub(rhs.y), ..]`.
582    #[inline]
583    #[must_use]
584    pub const fn saturating_sub(self, rhs: Self) -> Self {
585        Self {
586            x: self.x.saturating_sub(rhs.x),
587            y: self.y.saturating_sub(rhs.y),
588        }
589    }
590
591    /// Returns a vector containing the saturating multiplication of `self` and `rhs`.
592    ///
593    /// In other words this computes `[self.x.saturating_mul(rhs.x), self.y.saturating_mul(rhs.y), ..]`.
594    #[inline]
595    #[must_use]
596    pub const fn saturating_mul(self, rhs: Self) -> Self {
597        Self {
598            x: self.x.saturating_mul(rhs.x),
599            y: self.y.saturating_mul(rhs.y),
600        }
601    }
602
603    /// Returns a vector containing the saturating division of `self` and `rhs`.
604    ///
605    /// In other words this computes `[self.x.saturating_div(rhs.x), self.y.saturating_div(rhs.y), ..]`.
606    #[inline]
607    #[must_use]
608    pub const fn saturating_div(self, rhs: Self) -> Self {
609        Self {
610            x: self.x.saturating_div(rhs.x),
611            y: self.y.saturating_div(rhs.y),
612        }
613    }
614}
615
616impl Default for USizeVec2 {
617    #[inline(always)]
618    fn default() -> Self {
619        Self::ZERO
620    }
621}
622
623impl Div for USizeVec2 {
624    type Output = Self;
625    #[inline]
626    fn div(self, rhs: Self) -> Self {
627        Self {
628            x: self.x.div(rhs.x),
629            y: self.y.div(rhs.y),
630        }
631    }
632}
633
634impl Div<&Self> for USizeVec2 {
635    type Output = Self;
636    #[inline]
637    fn div(self, rhs: &Self) -> Self {
638        self.div(*rhs)
639    }
640}
641
642impl Div<&USizeVec2> for &USizeVec2 {
643    type Output = USizeVec2;
644    #[inline]
645    fn div(self, rhs: &USizeVec2) -> USizeVec2 {
646        (*self).div(*rhs)
647    }
648}
649
650impl Div<USizeVec2> for &USizeVec2 {
651    type Output = USizeVec2;
652    #[inline]
653    fn div(self, rhs: USizeVec2) -> USizeVec2 {
654        (*self).div(rhs)
655    }
656}
657
658impl DivAssign for USizeVec2 {
659    #[inline]
660    fn div_assign(&mut self, rhs: Self) {
661        self.x.div_assign(rhs.x);
662        self.y.div_assign(rhs.y);
663    }
664}
665
666impl DivAssign<&Self> for USizeVec2 {
667    #[inline]
668    fn div_assign(&mut self, rhs: &Self) {
669        self.div_assign(*rhs);
670    }
671}
672
673impl Div<usize> for USizeVec2 {
674    type Output = Self;
675    #[inline]
676    fn div(self, rhs: usize) -> Self {
677        Self {
678            x: self.x.div(rhs),
679            y: self.y.div(rhs),
680        }
681    }
682}
683
684impl Div<&usize> for USizeVec2 {
685    type Output = Self;
686    #[inline]
687    fn div(self, rhs: &usize) -> Self {
688        self.div(*rhs)
689    }
690}
691
692impl Div<&usize> for &USizeVec2 {
693    type Output = USizeVec2;
694    #[inline]
695    fn div(self, rhs: &usize) -> USizeVec2 {
696        (*self).div(*rhs)
697    }
698}
699
700impl Div<usize> for &USizeVec2 {
701    type Output = USizeVec2;
702    #[inline]
703    fn div(self, rhs: usize) -> USizeVec2 {
704        (*self).div(rhs)
705    }
706}
707
708impl DivAssign<usize> for USizeVec2 {
709    #[inline]
710    fn div_assign(&mut self, rhs: usize) {
711        self.x.div_assign(rhs);
712        self.y.div_assign(rhs);
713    }
714}
715
716impl DivAssign<&usize> for USizeVec2 {
717    #[inline]
718    fn div_assign(&mut self, rhs: &usize) {
719        self.div_assign(*rhs);
720    }
721}
722
723impl Div<USizeVec2> for usize {
724    type Output = USizeVec2;
725    #[inline]
726    fn div(self, rhs: USizeVec2) -> USizeVec2 {
727        USizeVec2 {
728            x: self.div(rhs.x),
729            y: self.div(rhs.y),
730        }
731    }
732}
733
734impl Div<&USizeVec2> for usize {
735    type Output = USizeVec2;
736    #[inline]
737    fn div(self, rhs: &USizeVec2) -> USizeVec2 {
738        self.div(*rhs)
739    }
740}
741
742impl Div<&USizeVec2> for &usize {
743    type Output = USizeVec2;
744    #[inline]
745    fn div(self, rhs: &USizeVec2) -> USizeVec2 {
746        (*self).div(*rhs)
747    }
748}
749
750impl Div<USizeVec2> for &usize {
751    type Output = USizeVec2;
752    #[inline]
753    fn div(self, rhs: USizeVec2) -> USizeVec2 {
754        (*self).div(rhs)
755    }
756}
757
758impl Mul for USizeVec2 {
759    type Output = Self;
760    #[inline]
761    fn mul(self, rhs: Self) -> Self {
762        Self {
763            x: self.x.mul(rhs.x),
764            y: self.y.mul(rhs.y),
765        }
766    }
767}
768
769impl Mul<&Self> for USizeVec2 {
770    type Output = Self;
771    #[inline]
772    fn mul(self, rhs: &Self) -> Self {
773        self.mul(*rhs)
774    }
775}
776
777impl Mul<&USizeVec2> for &USizeVec2 {
778    type Output = USizeVec2;
779    #[inline]
780    fn mul(self, rhs: &USizeVec2) -> USizeVec2 {
781        (*self).mul(*rhs)
782    }
783}
784
785impl Mul<USizeVec2> for &USizeVec2 {
786    type Output = USizeVec2;
787    #[inline]
788    fn mul(self, rhs: USizeVec2) -> USizeVec2 {
789        (*self).mul(rhs)
790    }
791}
792
793impl MulAssign for USizeVec2 {
794    #[inline]
795    fn mul_assign(&mut self, rhs: Self) {
796        self.x.mul_assign(rhs.x);
797        self.y.mul_assign(rhs.y);
798    }
799}
800
801impl MulAssign<&Self> for USizeVec2 {
802    #[inline]
803    fn mul_assign(&mut self, rhs: &Self) {
804        self.mul_assign(*rhs);
805    }
806}
807
808impl Mul<usize> for USizeVec2 {
809    type Output = Self;
810    #[inline]
811    fn mul(self, rhs: usize) -> Self {
812        Self {
813            x: self.x.mul(rhs),
814            y: self.y.mul(rhs),
815        }
816    }
817}
818
819impl Mul<&usize> for USizeVec2 {
820    type Output = Self;
821    #[inline]
822    fn mul(self, rhs: &usize) -> Self {
823        self.mul(*rhs)
824    }
825}
826
827impl Mul<&usize> for &USizeVec2 {
828    type Output = USizeVec2;
829    #[inline]
830    fn mul(self, rhs: &usize) -> USizeVec2 {
831        (*self).mul(*rhs)
832    }
833}
834
835impl Mul<usize> for &USizeVec2 {
836    type Output = USizeVec2;
837    #[inline]
838    fn mul(self, rhs: usize) -> USizeVec2 {
839        (*self).mul(rhs)
840    }
841}
842
843impl MulAssign<usize> for USizeVec2 {
844    #[inline]
845    fn mul_assign(&mut self, rhs: usize) {
846        self.x.mul_assign(rhs);
847        self.y.mul_assign(rhs);
848    }
849}
850
851impl MulAssign<&usize> for USizeVec2 {
852    #[inline]
853    fn mul_assign(&mut self, rhs: &usize) {
854        self.mul_assign(*rhs);
855    }
856}
857
858impl Mul<USizeVec2> for usize {
859    type Output = USizeVec2;
860    #[inline]
861    fn mul(self, rhs: USizeVec2) -> USizeVec2 {
862        USizeVec2 {
863            x: self.mul(rhs.x),
864            y: self.mul(rhs.y),
865        }
866    }
867}
868
869impl Mul<&USizeVec2> for usize {
870    type Output = USizeVec2;
871    #[inline]
872    fn mul(self, rhs: &USizeVec2) -> USizeVec2 {
873        self.mul(*rhs)
874    }
875}
876
877impl Mul<&USizeVec2> for &usize {
878    type Output = USizeVec2;
879    #[inline]
880    fn mul(self, rhs: &USizeVec2) -> USizeVec2 {
881        (*self).mul(*rhs)
882    }
883}
884
885impl Mul<USizeVec2> for &usize {
886    type Output = USizeVec2;
887    #[inline]
888    fn mul(self, rhs: USizeVec2) -> USizeVec2 {
889        (*self).mul(rhs)
890    }
891}
892
893impl Add for USizeVec2 {
894    type Output = Self;
895    #[inline]
896    fn add(self, rhs: Self) -> Self {
897        Self {
898            x: self.x.add(rhs.x),
899            y: self.y.add(rhs.y),
900        }
901    }
902}
903
904impl Add<&Self> for USizeVec2 {
905    type Output = Self;
906    #[inline]
907    fn add(self, rhs: &Self) -> Self {
908        self.add(*rhs)
909    }
910}
911
912impl Add<&USizeVec2> for &USizeVec2 {
913    type Output = USizeVec2;
914    #[inline]
915    fn add(self, rhs: &USizeVec2) -> USizeVec2 {
916        (*self).add(*rhs)
917    }
918}
919
920impl Add<USizeVec2> for &USizeVec2 {
921    type Output = USizeVec2;
922    #[inline]
923    fn add(self, rhs: USizeVec2) -> USizeVec2 {
924        (*self).add(rhs)
925    }
926}
927
928impl AddAssign for USizeVec2 {
929    #[inline]
930    fn add_assign(&mut self, rhs: Self) {
931        self.x.add_assign(rhs.x);
932        self.y.add_assign(rhs.y);
933    }
934}
935
936impl AddAssign<&Self> for USizeVec2 {
937    #[inline]
938    fn add_assign(&mut self, rhs: &Self) {
939        self.add_assign(*rhs);
940    }
941}
942
943impl Add<usize> for USizeVec2 {
944    type Output = Self;
945    #[inline]
946    fn add(self, rhs: usize) -> Self {
947        Self {
948            x: self.x.add(rhs),
949            y: self.y.add(rhs),
950        }
951    }
952}
953
954impl Add<&usize> for USizeVec2 {
955    type Output = Self;
956    #[inline]
957    fn add(self, rhs: &usize) -> Self {
958        self.add(*rhs)
959    }
960}
961
962impl Add<&usize> for &USizeVec2 {
963    type Output = USizeVec2;
964    #[inline]
965    fn add(self, rhs: &usize) -> USizeVec2 {
966        (*self).add(*rhs)
967    }
968}
969
970impl Add<usize> for &USizeVec2 {
971    type Output = USizeVec2;
972    #[inline]
973    fn add(self, rhs: usize) -> USizeVec2 {
974        (*self).add(rhs)
975    }
976}
977
978impl AddAssign<usize> for USizeVec2 {
979    #[inline]
980    fn add_assign(&mut self, rhs: usize) {
981        self.x.add_assign(rhs);
982        self.y.add_assign(rhs);
983    }
984}
985
986impl AddAssign<&usize> for USizeVec2 {
987    #[inline]
988    fn add_assign(&mut self, rhs: &usize) {
989        self.add_assign(*rhs);
990    }
991}
992
993impl Add<USizeVec2> for usize {
994    type Output = USizeVec2;
995    #[inline]
996    fn add(self, rhs: USizeVec2) -> USizeVec2 {
997        USizeVec2 {
998            x: self.add(rhs.x),
999            y: self.add(rhs.y),
1000        }
1001    }
1002}
1003
1004impl Add<&USizeVec2> for usize {
1005    type Output = USizeVec2;
1006    #[inline]
1007    fn add(self, rhs: &USizeVec2) -> USizeVec2 {
1008        self.add(*rhs)
1009    }
1010}
1011
1012impl Add<&USizeVec2> for &usize {
1013    type Output = USizeVec2;
1014    #[inline]
1015    fn add(self, rhs: &USizeVec2) -> USizeVec2 {
1016        (*self).add(*rhs)
1017    }
1018}
1019
1020impl Add<USizeVec2> for &usize {
1021    type Output = USizeVec2;
1022    #[inline]
1023    fn add(self, rhs: USizeVec2) -> USizeVec2 {
1024        (*self).add(rhs)
1025    }
1026}
1027
1028impl Sub for USizeVec2 {
1029    type Output = Self;
1030    #[inline]
1031    fn sub(self, rhs: Self) -> Self {
1032        Self {
1033            x: self.x.sub(rhs.x),
1034            y: self.y.sub(rhs.y),
1035        }
1036    }
1037}
1038
1039impl Sub<&Self> for USizeVec2 {
1040    type Output = Self;
1041    #[inline]
1042    fn sub(self, rhs: &Self) -> Self {
1043        self.sub(*rhs)
1044    }
1045}
1046
1047impl Sub<&USizeVec2> for &USizeVec2 {
1048    type Output = USizeVec2;
1049    #[inline]
1050    fn sub(self, rhs: &USizeVec2) -> USizeVec2 {
1051        (*self).sub(*rhs)
1052    }
1053}
1054
1055impl Sub<USizeVec2> for &USizeVec2 {
1056    type Output = USizeVec2;
1057    #[inline]
1058    fn sub(self, rhs: USizeVec2) -> USizeVec2 {
1059        (*self).sub(rhs)
1060    }
1061}
1062
1063impl SubAssign for USizeVec2 {
1064    #[inline]
1065    fn sub_assign(&mut self, rhs: Self) {
1066        self.x.sub_assign(rhs.x);
1067        self.y.sub_assign(rhs.y);
1068    }
1069}
1070
1071impl SubAssign<&Self> for USizeVec2 {
1072    #[inline]
1073    fn sub_assign(&mut self, rhs: &Self) {
1074        self.sub_assign(*rhs);
1075    }
1076}
1077
1078impl Sub<usize> for USizeVec2 {
1079    type Output = Self;
1080    #[inline]
1081    fn sub(self, rhs: usize) -> Self {
1082        Self {
1083            x: self.x.sub(rhs),
1084            y: self.y.sub(rhs),
1085        }
1086    }
1087}
1088
1089impl Sub<&usize> for USizeVec2 {
1090    type Output = Self;
1091    #[inline]
1092    fn sub(self, rhs: &usize) -> Self {
1093        self.sub(*rhs)
1094    }
1095}
1096
1097impl Sub<&usize> for &USizeVec2 {
1098    type Output = USizeVec2;
1099    #[inline]
1100    fn sub(self, rhs: &usize) -> USizeVec2 {
1101        (*self).sub(*rhs)
1102    }
1103}
1104
1105impl Sub<usize> for &USizeVec2 {
1106    type Output = USizeVec2;
1107    #[inline]
1108    fn sub(self, rhs: usize) -> USizeVec2 {
1109        (*self).sub(rhs)
1110    }
1111}
1112
1113impl SubAssign<usize> for USizeVec2 {
1114    #[inline]
1115    fn sub_assign(&mut self, rhs: usize) {
1116        self.x.sub_assign(rhs);
1117        self.y.sub_assign(rhs);
1118    }
1119}
1120
1121impl SubAssign<&usize> for USizeVec2 {
1122    #[inline]
1123    fn sub_assign(&mut self, rhs: &usize) {
1124        self.sub_assign(*rhs);
1125    }
1126}
1127
1128impl Sub<USizeVec2> for usize {
1129    type Output = USizeVec2;
1130    #[inline]
1131    fn sub(self, rhs: USizeVec2) -> USizeVec2 {
1132        USizeVec2 {
1133            x: self.sub(rhs.x),
1134            y: self.sub(rhs.y),
1135        }
1136    }
1137}
1138
1139impl Sub<&USizeVec2> for usize {
1140    type Output = USizeVec2;
1141    #[inline]
1142    fn sub(self, rhs: &USizeVec2) -> USizeVec2 {
1143        self.sub(*rhs)
1144    }
1145}
1146
1147impl Sub<&USizeVec2> for &usize {
1148    type Output = USizeVec2;
1149    #[inline]
1150    fn sub(self, rhs: &USizeVec2) -> USizeVec2 {
1151        (*self).sub(*rhs)
1152    }
1153}
1154
1155impl Sub<USizeVec2> for &usize {
1156    type Output = USizeVec2;
1157    #[inline]
1158    fn sub(self, rhs: USizeVec2) -> USizeVec2 {
1159        (*self).sub(rhs)
1160    }
1161}
1162
1163impl Rem for USizeVec2 {
1164    type Output = Self;
1165    #[inline]
1166    fn rem(self, rhs: Self) -> Self {
1167        Self {
1168            x: self.x.rem(rhs.x),
1169            y: self.y.rem(rhs.y),
1170        }
1171    }
1172}
1173
1174impl Rem<&Self> for USizeVec2 {
1175    type Output = Self;
1176    #[inline]
1177    fn rem(self, rhs: &Self) -> Self {
1178        self.rem(*rhs)
1179    }
1180}
1181
1182impl Rem<&USizeVec2> for &USizeVec2 {
1183    type Output = USizeVec2;
1184    #[inline]
1185    fn rem(self, rhs: &USizeVec2) -> USizeVec2 {
1186        (*self).rem(*rhs)
1187    }
1188}
1189
1190impl Rem<USizeVec2> for &USizeVec2 {
1191    type Output = USizeVec2;
1192    #[inline]
1193    fn rem(self, rhs: USizeVec2) -> USizeVec2 {
1194        (*self).rem(rhs)
1195    }
1196}
1197
1198impl RemAssign for USizeVec2 {
1199    #[inline]
1200    fn rem_assign(&mut self, rhs: Self) {
1201        self.x.rem_assign(rhs.x);
1202        self.y.rem_assign(rhs.y);
1203    }
1204}
1205
1206impl RemAssign<&Self> for USizeVec2 {
1207    #[inline]
1208    fn rem_assign(&mut self, rhs: &Self) {
1209        self.rem_assign(*rhs);
1210    }
1211}
1212
1213impl Rem<usize> for USizeVec2 {
1214    type Output = Self;
1215    #[inline]
1216    fn rem(self, rhs: usize) -> Self {
1217        Self {
1218            x: self.x.rem(rhs),
1219            y: self.y.rem(rhs),
1220        }
1221    }
1222}
1223
1224impl Rem<&usize> for USizeVec2 {
1225    type Output = Self;
1226    #[inline]
1227    fn rem(self, rhs: &usize) -> Self {
1228        self.rem(*rhs)
1229    }
1230}
1231
1232impl Rem<&usize> for &USizeVec2 {
1233    type Output = USizeVec2;
1234    #[inline]
1235    fn rem(self, rhs: &usize) -> USizeVec2 {
1236        (*self).rem(*rhs)
1237    }
1238}
1239
1240impl Rem<usize> for &USizeVec2 {
1241    type Output = USizeVec2;
1242    #[inline]
1243    fn rem(self, rhs: usize) -> USizeVec2 {
1244        (*self).rem(rhs)
1245    }
1246}
1247
1248impl RemAssign<usize> for USizeVec2 {
1249    #[inline]
1250    fn rem_assign(&mut self, rhs: usize) {
1251        self.x.rem_assign(rhs);
1252        self.y.rem_assign(rhs);
1253    }
1254}
1255
1256impl RemAssign<&usize> for USizeVec2 {
1257    #[inline]
1258    fn rem_assign(&mut self, rhs: &usize) {
1259        self.rem_assign(*rhs);
1260    }
1261}
1262
1263impl Rem<USizeVec2> for usize {
1264    type Output = USizeVec2;
1265    #[inline]
1266    fn rem(self, rhs: USizeVec2) -> USizeVec2 {
1267        USizeVec2 {
1268            x: self.rem(rhs.x),
1269            y: self.rem(rhs.y),
1270        }
1271    }
1272}
1273
1274impl Rem<&USizeVec2> for usize {
1275    type Output = USizeVec2;
1276    #[inline]
1277    fn rem(self, rhs: &USizeVec2) -> USizeVec2 {
1278        self.rem(*rhs)
1279    }
1280}
1281
1282impl Rem<&USizeVec2> for &usize {
1283    type Output = USizeVec2;
1284    #[inline]
1285    fn rem(self, rhs: &USizeVec2) -> USizeVec2 {
1286        (*self).rem(*rhs)
1287    }
1288}
1289
1290impl Rem<USizeVec2> for &usize {
1291    type Output = USizeVec2;
1292    #[inline]
1293    fn rem(self, rhs: USizeVec2) -> USizeVec2 {
1294        (*self).rem(rhs)
1295    }
1296}
1297
1298#[cfg(not(target_arch = "spirv"))]
1299impl AsRef<[usize; 2]> for USizeVec2 {
1300    #[inline]
1301    fn as_ref(&self) -> &[usize; 2] {
1302        unsafe { &*(self as *const Self as *const [usize; 2]) }
1303    }
1304}
1305
1306#[cfg(not(target_arch = "spirv"))]
1307impl AsMut<[usize; 2]> for USizeVec2 {
1308    #[inline]
1309    fn as_mut(&mut self) -> &mut [usize; 2] {
1310        unsafe { &mut *(self as *mut Self as *mut [usize; 2]) }
1311    }
1312}
1313
1314impl Sum for USizeVec2 {
1315    #[inline]
1316    fn sum<I>(iter: I) -> Self
1317    where
1318        I: Iterator<Item = Self>,
1319    {
1320        iter.fold(Self::ZERO, Self::add)
1321    }
1322}
1323
1324impl<'a> Sum<&'a Self> for USizeVec2 {
1325    #[inline]
1326    fn sum<I>(iter: I) -> Self
1327    where
1328        I: Iterator<Item = &'a Self>,
1329    {
1330        iter.fold(Self::ZERO, |a, &b| Self::add(a, b))
1331    }
1332}
1333
1334impl Product for USizeVec2 {
1335    #[inline]
1336    fn product<I>(iter: I) -> Self
1337    where
1338        I: Iterator<Item = Self>,
1339    {
1340        iter.fold(Self::ONE, Self::mul)
1341    }
1342}
1343
1344impl<'a> Product<&'a Self> for USizeVec2 {
1345    #[inline]
1346    fn product<I>(iter: I) -> Self
1347    where
1348        I: Iterator<Item = &'a Self>,
1349    {
1350        iter.fold(Self::ONE, |a, &b| Self::mul(a, b))
1351    }
1352}
1353
1354impl Not for USizeVec2 {
1355    type Output = Self;
1356    #[inline]
1357    fn not(self) -> Self {
1358        Self {
1359            x: self.x.not(),
1360            y: self.y.not(),
1361        }
1362    }
1363}
1364
1365impl Not for &USizeVec2 {
1366    type Output = USizeVec2;
1367    #[inline]
1368    fn not(self) -> USizeVec2 {
1369        (*self).not()
1370    }
1371}
1372
1373impl BitAnd for USizeVec2 {
1374    type Output = Self;
1375    #[inline]
1376    fn bitand(self, rhs: Self) -> Self::Output {
1377        Self {
1378            x: self.x.bitand(rhs.x),
1379            y: self.y.bitand(rhs.y),
1380        }
1381    }
1382}
1383
1384impl BitAnd<&Self> for USizeVec2 {
1385    type Output = Self;
1386    #[inline]
1387    fn bitand(self, rhs: &Self) -> Self {
1388        self.bitand(*rhs)
1389    }
1390}
1391
1392impl BitAnd<&USizeVec2> for &USizeVec2 {
1393    type Output = USizeVec2;
1394    #[inline]
1395    fn bitand(self, rhs: &USizeVec2) -> USizeVec2 {
1396        (*self).bitand(*rhs)
1397    }
1398}
1399
1400impl BitAnd<USizeVec2> for &USizeVec2 {
1401    type Output = USizeVec2;
1402    #[inline]
1403    fn bitand(self, rhs: USizeVec2) -> USizeVec2 {
1404        (*self).bitand(rhs)
1405    }
1406}
1407
1408impl BitAndAssign for USizeVec2 {
1409    #[inline]
1410    fn bitand_assign(&mut self, rhs: Self) {
1411        *self = self.bitand(rhs);
1412    }
1413}
1414
1415impl BitAndAssign<&Self> for USizeVec2 {
1416    #[inline]
1417    fn bitand_assign(&mut self, rhs: &Self) {
1418        self.bitand_assign(*rhs);
1419    }
1420}
1421
1422impl BitOr for USizeVec2 {
1423    type Output = Self;
1424    #[inline]
1425    fn bitor(self, rhs: Self) -> Self::Output {
1426        Self {
1427            x: self.x.bitor(rhs.x),
1428            y: self.y.bitor(rhs.y),
1429        }
1430    }
1431}
1432
1433impl BitOr<&Self> for USizeVec2 {
1434    type Output = Self;
1435    #[inline]
1436    fn bitor(self, rhs: &Self) -> Self {
1437        self.bitor(*rhs)
1438    }
1439}
1440
1441impl BitOr<&USizeVec2> for &USizeVec2 {
1442    type Output = USizeVec2;
1443    #[inline]
1444    fn bitor(self, rhs: &USizeVec2) -> USizeVec2 {
1445        (*self).bitor(*rhs)
1446    }
1447}
1448
1449impl BitOr<USizeVec2> for &USizeVec2 {
1450    type Output = USizeVec2;
1451    #[inline]
1452    fn bitor(self, rhs: USizeVec2) -> USizeVec2 {
1453        (*self).bitor(rhs)
1454    }
1455}
1456
1457impl BitOrAssign for USizeVec2 {
1458    #[inline]
1459    fn bitor_assign(&mut self, rhs: Self) {
1460        *self = self.bitor(rhs);
1461    }
1462}
1463
1464impl BitOrAssign<&Self> for USizeVec2 {
1465    #[inline]
1466    fn bitor_assign(&mut self, rhs: &Self) {
1467        self.bitor_assign(*rhs);
1468    }
1469}
1470
1471impl BitXor for USizeVec2 {
1472    type Output = Self;
1473    #[inline]
1474    fn bitxor(self, rhs: Self) -> Self::Output {
1475        Self {
1476            x: self.x.bitxor(rhs.x),
1477            y: self.y.bitxor(rhs.y),
1478        }
1479    }
1480}
1481
1482impl BitXor<&Self> for USizeVec2 {
1483    type Output = Self;
1484    #[inline]
1485    fn bitxor(self, rhs: &Self) -> Self {
1486        self.bitxor(*rhs)
1487    }
1488}
1489
1490impl BitXor<&USizeVec2> for &USizeVec2 {
1491    type Output = USizeVec2;
1492    #[inline]
1493    fn bitxor(self, rhs: &USizeVec2) -> USizeVec2 {
1494        (*self).bitxor(*rhs)
1495    }
1496}
1497
1498impl BitXor<USizeVec2> for &USizeVec2 {
1499    type Output = USizeVec2;
1500    #[inline]
1501    fn bitxor(self, rhs: USizeVec2) -> USizeVec2 {
1502        (*self).bitxor(rhs)
1503    }
1504}
1505
1506impl BitXorAssign for USizeVec2 {
1507    #[inline]
1508    fn bitxor_assign(&mut self, rhs: Self) {
1509        *self = self.bitxor(rhs);
1510    }
1511}
1512
1513impl BitXorAssign<&Self> for USizeVec2 {
1514    #[inline]
1515    fn bitxor_assign(&mut self, rhs: &Self) {
1516        self.bitxor_assign(*rhs);
1517    }
1518}
1519
1520impl BitAnd<usize> for USizeVec2 {
1521    type Output = Self;
1522    #[inline]
1523    fn bitand(self, rhs: usize) -> Self::Output {
1524        Self {
1525            x: self.x.bitand(rhs),
1526            y: self.y.bitand(rhs),
1527        }
1528    }
1529}
1530
1531impl BitAnd<&usize> for USizeVec2 {
1532    type Output = Self;
1533    #[inline]
1534    fn bitand(self, rhs: &usize) -> Self {
1535        self.bitand(*rhs)
1536    }
1537}
1538
1539impl BitAnd<&usize> for &USizeVec2 {
1540    type Output = USizeVec2;
1541    #[inline]
1542    fn bitand(self, rhs: &usize) -> USizeVec2 {
1543        (*self).bitand(*rhs)
1544    }
1545}
1546
1547impl BitAnd<usize> for &USizeVec2 {
1548    type Output = USizeVec2;
1549    #[inline]
1550    fn bitand(self, rhs: usize) -> USizeVec2 {
1551        (*self).bitand(rhs)
1552    }
1553}
1554
1555impl BitAndAssign<usize> for USizeVec2 {
1556    #[inline]
1557    fn bitand_assign(&mut self, rhs: usize) {
1558        *self = self.bitand(rhs);
1559    }
1560}
1561
1562impl BitAndAssign<&usize> for USizeVec2 {
1563    #[inline]
1564    fn bitand_assign(&mut self, rhs: &usize) {
1565        self.bitand_assign(*rhs);
1566    }
1567}
1568
1569impl BitOr<usize> for USizeVec2 {
1570    type Output = Self;
1571    #[inline]
1572    fn bitor(self, rhs: usize) -> Self::Output {
1573        Self {
1574            x: self.x.bitor(rhs),
1575            y: self.y.bitor(rhs),
1576        }
1577    }
1578}
1579
1580impl BitOr<&usize> for USizeVec2 {
1581    type Output = Self;
1582    #[inline]
1583    fn bitor(self, rhs: &usize) -> Self {
1584        self.bitor(*rhs)
1585    }
1586}
1587
1588impl BitOr<&usize> for &USizeVec2 {
1589    type Output = USizeVec2;
1590    #[inline]
1591    fn bitor(self, rhs: &usize) -> USizeVec2 {
1592        (*self).bitor(*rhs)
1593    }
1594}
1595
1596impl BitOr<usize> for &USizeVec2 {
1597    type Output = USizeVec2;
1598    #[inline]
1599    fn bitor(self, rhs: usize) -> USizeVec2 {
1600        (*self).bitor(rhs)
1601    }
1602}
1603
1604impl BitOrAssign<usize> for USizeVec2 {
1605    #[inline]
1606    fn bitor_assign(&mut self, rhs: usize) {
1607        *self = self.bitor(rhs);
1608    }
1609}
1610
1611impl BitOrAssign<&usize> for USizeVec2 {
1612    #[inline]
1613    fn bitor_assign(&mut self, rhs: &usize) {
1614        self.bitor_assign(*rhs);
1615    }
1616}
1617
1618impl BitXor<usize> for USizeVec2 {
1619    type Output = Self;
1620    #[inline]
1621    fn bitxor(self, rhs: usize) -> Self::Output {
1622        Self {
1623            x: self.x.bitxor(rhs),
1624            y: self.y.bitxor(rhs),
1625        }
1626    }
1627}
1628
1629impl BitXor<&usize> for USizeVec2 {
1630    type Output = Self;
1631    #[inline]
1632    fn bitxor(self, rhs: &usize) -> Self {
1633        self.bitxor(*rhs)
1634    }
1635}
1636
1637impl BitXor<&usize> for &USizeVec2 {
1638    type Output = USizeVec2;
1639    #[inline]
1640    fn bitxor(self, rhs: &usize) -> USizeVec2 {
1641        (*self).bitxor(*rhs)
1642    }
1643}
1644
1645impl BitXor<usize> for &USizeVec2 {
1646    type Output = USizeVec2;
1647    #[inline]
1648    fn bitxor(self, rhs: usize) -> USizeVec2 {
1649        (*self).bitxor(rhs)
1650    }
1651}
1652
1653impl BitXorAssign<usize> for USizeVec2 {
1654    #[inline]
1655    fn bitxor_assign(&mut self, rhs: usize) {
1656        *self = self.bitxor(rhs);
1657    }
1658}
1659
1660impl BitXorAssign<&usize> for USizeVec2 {
1661    #[inline]
1662    fn bitxor_assign(&mut self, rhs: &usize) {
1663        self.bitxor_assign(*rhs);
1664    }
1665}
1666
1667impl Shl<i8> for USizeVec2 {
1668    type Output = Self;
1669    #[inline]
1670    fn shl(self, rhs: i8) -> Self::Output {
1671        Self {
1672            x: self.x.shl(rhs),
1673            y: self.y.shl(rhs),
1674        }
1675    }
1676}
1677
1678impl Shl<&i8> for USizeVec2 {
1679    type Output = Self;
1680    #[inline]
1681    fn shl(self, rhs: &i8) -> Self {
1682        self.shl(*rhs)
1683    }
1684}
1685
1686impl Shl<&i8> for &USizeVec2 {
1687    type Output = USizeVec2;
1688    #[inline]
1689    fn shl(self, rhs: &i8) -> USizeVec2 {
1690        (*self).shl(*rhs)
1691    }
1692}
1693
1694impl Shl<i8> for &USizeVec2 {
1695    type Output = USizeVec2;
1696    #[inline]
1697    fn shl(self, rhs: i8) -> USizeVec2 {
1698        (*self).shl(rhs)
1699    }
1700}
1701
1702impl ShlAssign<i8> for USizeVec2 {
1703    #[inline]
1704    fn shl_assign(&mut self, rhs: i8) {
1705        *self = self.shl(rhs);
1706    }
1707}
1708
1709impl ShlAssign<&i8> for USizeVec2 {
1710    #[inline]
1711    fn shl_assign(&mut self, rhs: &i8) {
1712        self.shl_assign(*rhs);
1713    }
1714}
1715
1716impl Shr<i8> for USizeVec2 {
1717    type Output = Self;
1718    #[inline]
1719    fn shr(self, rhs: i8) -> Self::Output {
1720        Self {
1721            x: self.x.shr(rhs),
1722            y: self.y.shr(rhs),
1723        }
1724    }
1725}
1726
1727impl Shr<&i8> for USizeVec2 {
1728    type Output = Self;
1729    #[inline]
1730    fn shr(self, rhs: &i8) -> Self {
1731        self.shr(*rhs)
1732    }
1733}
1734
1735impl Shr<&i8> for &USizeVec2 {
1736    type Output = USizeVec2;
1737    #[inline]
1738    fn shr(self, rhs: &i8) -> USizeVec2 {
1739        (*self).shr(*rhs)
1740    }
1741}
1742
1743impl Shr<i8> for &USizeVec2 {
1744    type Output = USizeVec2;
1745    #[inline]
1746    fn shr(self, rhs: i8) -> USizeVec2 {
1747        (*self).shr(rhs)
1748    }
1749}
1750
1751impl ShrAssign<i8> for USizeVec2 {
1752    #[inline]
1753    fn shr_assign(&mut self, rhs: i8) {
1754        *self = self.shr(rhs);
1755    }
1756}
1757
1758impl ShrAssign<&i8> for USizeVec2 {
1759    #[inline]
1760    fn shr_assign(&mut self, rhs: &i8) {
1761        self.shr_assign(*rhs);
1762    }
1763}
1764
1765impl Shl<i16> for USizeVec2 {
1766    type Output = Self;
1767    #[inline]
1768    fn shl(self, rhs: i16) -> Self::Output {
1769        Self {
1770            x: self.x.shl(rhs),
1771            y: self.y.shl(rhs),
1772        }
1773    }
1774}
1775
1776impl Shl<&i16> for USizeVec2 {
1777    type Output = Self;
1778    #[inline]
1779    fn shl(self, rhs: &i16) -> Self {
1780        self.shl(*rhs)
1781    }
1782}
1783
1784impl Shl<&i16> for &USizeVec2 {
1785    type Output = USizeVec2;
1786    #[inline]
1787    fn shl(self, rhs: &i16) -> USizeVec2 {
1788        (*self).shl(*rhs)
1789    }
1790}
1791
1792impl Shl<i16> for &USizeVec2 {
1793    type Output = USizeVec2;
1794    #[inline]
1795    fn shl(self, rhs: i16) -> USizeVec2 {
1796        (*self).shl(rhs)
1797    }
1798}
1799
1800impl ShlAssign<i16> for USizeVec2 {
1801    #[inline]
1802    fn shl_assign(&mut self, rhs: i16) {
1803        *self = self.shl(rhs);
1804    }
1805}
1806
1807impl ShlAssign<&i16> for USizeVec2 {
1808    #[inline]
1809    fn shl_assign(&mut self, rhs: &i16) {
1810        self.shl_assign(*rhs);
1811    }
1812}
1813
1814impl Shr<i16> for USizeVec2 {
1815    type Output = Self;
1816    #[inline]
1817    fn shr(self, rhs: i16) -> Self::Output {
1818        Self {
1819            x: self.x.shr(rhs),
1820            y: self.y.shr(rhs),
1821        }
1822    }
1823}
1824
1825impl Shr<&i16> for USizeVec2 {
1826    type Output = Self;
1827    #[inline]
1828    fn shr(self, rhs: &i16) -> Self {
1829        self.shr(*rhs)
1830    }
1831}
1832
1833impl Shr<&i16> for &USizeVec2 {
1834    type Output = USizeVec2;
1835    #[inline]
1836    fn shr(self, rhs: &i16) -> USizeVec2 {
1837        (*self).shr(*rhs)
1838    }
1839}
1840
1841impl Shr<i16> for &USizeVec2 {
1842    type Output = USizeVec2;
1843    #[inline]
1844    fn shr(self, rhs: i16) -> USizeVec2 {
1845        (*self).shr(rhs)
1846    }
1847}
1848
1849impl ShrAssign<i16> for USizeVec2 {
1850    #[inline]
1851    fn shr_assign(&mut self, rhs: i16) {
1852        *self = self.shr(rhs);
1853    }
1854}
1855
1856impl ShrAssign<&i16> for USizeVec2 {
1857    #[inline]
1858    fn shr_assign(&mut self, rhs: &i16) {
1859        self.shr_assign(*rhs);
1860    }
1861}
1862
1863impl Shl<i32> for USizeVec2 {
1864    type Output = Self;
1865    #[inline]
1866    fn shl(self, rhs: i32) -> Self::Output {
1867        Self {
1868            x: self.x.shl(rhs),
1869            y: self.y.shl(rhs),
1870        }
1871    }
1872}
1873
1874impl Shl<&i32> for USizeVec2 {
1875    type Output = Self;
1876    #[inline]
1877    fn shl(self, rhs: &i32) -> Self {
1878        self.shl(*rhs)
1879    }
1880}
1881
1882impl Shl<&i32> for &USizeVec2 {
1883    type Output = USizeVec2;
1884    #[inline]
1885    fn shl(self, rhs: &i32) -> USizeVec2 {
1886        (*self).shl(*rhs)
1887    }
1888}
1889
1890impl Shl<i32> for &USizeVec2 {
1891    type Output = USizeVec2;
1892    #[inline]
1893    fn shl(self, rhs: i32) -> USizeVec2 {
1894        (*self).shl(rhs)
1895    }
1896}
1897
1898impl ShlAssign<i32> for USizeVec2 {
1899    #[inline]
1900    fn shl_assign(&mut self, rhs: i32) {
1901        *self = self.shl(rhs);
1902    }
1903}
1904
1905impl ShlAssign<&i32> for USizeVec2 {
1906    #[inline]
1907    fn shl_assign(&mut self, rhs: &i32) {
1908        self.shl_assign(*rhs);
1909    }
1910}
1911
1912impl Shr<i32> for USizeVec2 {
1913    type Output = Self;
1914    #[inline]
1915    fn shr(self, rhs: i32) -> Self::Output {
1916        Self {
1917            x: self.x.shr(rhs),
1918            y: self.y.shr(rhs),
1919        }
1920    }
1921}
1922
1923impl Shr<&i32> for USizeVec2 {
1924    type Output = Self;
1925    #[inline]
1926    fn shr(self, rhs: &i32) -> Self {
1927        self.shr(*rhs)
1928    }
1929}
1930
1931impl Shr<&i32> for &USizeVec2 {
1932    type Output = USizeVec2;
1933    #[inline]
1934    fn shr(self, rhs: &i32) -> USizeVec2 {
1935        (*self).shr(*rhs)
1936    }
1937}
1938
1939impl Shr<i32> for &USizeVec2 {
1940    type Output = USizeVec2;
1941    #[inline]
1942    fn shr(self, rhs: i32) -> USizeVec2 {
1943        (*self).shr(rhs)
1944    }
1945}
1946
1947impl ShrAssign<i32> for USizeVec2 {
1948    #[inline]
1949    fn shr_assign(&mut self, rhs: i32) {
1950        *self = self.shr(rhs);
1951    }
1952}
1953
1954impl ShrAssign<&i32> for USizeVec2 {
1955    #[inline]
1956    fn shr_assign(&mut self, rhs: &i32) {
1957        self.shr_assign(*rhs);
1958    }
1959}
1960
1961impl Shl<i64> for USizeVec2 {
1962    type Output = Self;
1963    #[inline]
1964    fn shl(self, rhs: i64) -> Self::Output {
1965        Self {
1966            x: self.x.shl(rhs),
1967            y: self.y.shl(rhs),
1968        }
1969    }
1970}
1971
1972impl Shl<&i64> for USizeVec2 {
1973    type Output = Self;
1974    #[inline]
1975    fn shl(self, rhs: &i64) -> Self {
1976        self.shl(*rhs)
1977    }
1978}
1979
1980impl Shl<&i64> for &USizeVec2 {
1981    type Output = USizeVec2;
1982    #[inline]
1983    fn shl(self, rhs: &i64) -> USizeVec2 {
1984        (*self).shl(*rhs)
1985    }
1986}
1987
1988impl Shl<i64> for &USizeVec2 {
1989    type Output = USizeVec2;
1990    #[inline]
1991    fn shl(self, rhs: i64) -> USizeVec2 {
1992        (*self).shl(rhs)
1993    }
1994}
1995
1996impl ShlAssign<i64> for USizeVec2 {
1997    #[inline]
1998    fn shl_assign(&mut self, rhs: i64) {
1999        *self = self.shl(rhs);
2000    }
2001}
2002
2003impl ShlAssign<&i64> for USizeVec2 {
2004    #[inline]
2005    fn shl_assign(&mut self, rhs: &i64) {
2006        self.shl_assign(*rhs);
2007    }
2008}
2009
2010impl Shr<i64> for USizeVec2 {
2011    type Output = Self;
2012    #[inline]
2013    fn shr(self, rhs: i64) -> Self::Output {
2014        Self {
2015            x: self.x.shr(rhs),
2016            y: self.y.shr(rhs),
2017        }
2018    }
2019}
2020
2021impl Shr<&i64> for USizeVec2 {
2022    type Output = Self;
2023    #[inline]
2024    fn shr(self, rhs: &i64) -> Self {
2025        self.shr(*rhs)
2026    }
2027}
2028
2029impl Shr<&i64> for &USizeVec2 {
2030    type Output = USizeVec2;
2031    #[inline]
2032    fn shr(self, rhs: &i64) -> USizeVec2 {
2033        (*self).shr(*rhs)
2034    }
2035}
2036
2037impl Shr<i64> for &USizeVec2 {
2038    type Output = USizeVec2;
2039    #[inline]
2040    fn shr(self, rhs: i64) -> USizeVec2 {
2041        (*self).shr(rhs)
2042    }
2043}
2044
2045impl ShrAssign<i64> for USizeVec2 {
2046    #[inline]
2047    fn shr_assign(&mut self, rhs: i64) {
2048        *self = self.shr(rhs);
2049    }
2050}
2051
2052impl ShrAssign<&i64> for USizeVec2 {
2053    #[inline]
2054    fn shr_assign(&mut self, rhs: &i64) {
2055        self.shr_assign(*rhs);
2056    }
2057}
2058
2059impl Shl<u8> for USizeVec2 {
2060    type Output = Self;
2061    #[inline]
2062    fn shl(self, rhs: u8) -> Self::Output {
2063        Self {
2064            x: self.x.shl(rhs),
2065            y: self.y.shl(rhs),
2066        }
2067    }
2068}
2069
2070impl Shl<&u8> for USizeVec2 {
2071    type Output = Self;
2072    #[inline]
2073    fn shl(self, rhs: &u8) -> Self {
2074        self.shl(*rhs)
2075    }
2076}
2077
2078impl Shl<&u8> for &USizeVec2 {
2079    type Output = USizeVec2;
2080    #[inline]
2081    fn shl(self, rhs: &u8) -> USizeVec2 {
2082        (*self).shl(*rhs)
2083    }
2084}
2085
2086impl Shl<u8> for &USizeVec2 {
2087    type Output = USizeVec2;
2088    #[inline]
2089    fn shl(self, rhs: u8) -> USizeVec2 {
2090        (*self).shl(rhs)
2091    }
2092}
2093
2094impl ShlAssign<u8> for USizeVec2 {
2095    #[inline]
2096    fn shl_assign(&mut self, rhs: u8) {
2097        *self = self.shl(rhs);
2098    }
2099}
2100
2101impl ShlAssign<&u8> for USizeVec2 {
2102    #[inline]
2103    fn shl_assign(&mut self, rhs: &u8) {
2104        self.shl_assign(*rhs);
2105    }
2106}
2107
2108impl Shr<u8> for USizeVec2 {
2109    type Output = Self;
2110    #[inline]
2111    fn shr(self, rhs: u8) -> Self::Output {
2112        Self {
2113            x: self.x.shr(rhs),
2114            y: self.y.shr(rhs),
2115        }
2116    }
2117}
2118
2119impl Shr<&u8> for USizeVec2 {
2120    type Output = Self;
2121    #[inline]
2122    fn shr(self, rhs: &u8) -> Self {
2123        self.shr(*rhs)
2124    }
2125}
2126
2127impl Shr<&u8> for &USizeVec2 {
2128    type Output = USizeVec2;
2129    #[inline]
2130    fn shr(self, rhs: &u8) -> USizeVec2 {
2131        (*self).shr(*rhs)
2132    }
2133}
2134
2135impl Shr<u8> for &USizeVec2 {
2136    type Output = USizeVec2;
2137    #[inline]
2138    fn shr(self, rhs: u8) -> USizeVec2 {
2139        (*self).shr(rhs)
2140    }
2141}
2142
2143impl ShrAssign<u8> for USizeVec2 {
2144    #[inline]
2145    fn shr_assign(&mut self, rhs: u8) {
2146        *self = self.shr(rhs);
2147    }
2148}
2149
2150impl ShrAssign<&u8> for USizeVec2 {
2151    #[inline]
2152    fn shr_assign(&mut self, rhs: &u8) {
2153        self.shr_assign(*rhs);
2154    }
2155}
2156
2157impl Shl<u16> for USizeVec2 {
2158    type Output = Self;
2159    #[inline]
2160    fn shl(self, rhs: u16) -> Self::Output {
2161        Self {
2162            x: self.x.shl(rhs),
2163            y: self.y.shl(rhs),
2164        }
2165    }
2166}
2167
2168impl Shl<&u16> for USizeVec2 {
2169    type Output = Self;
2170    #[inline]
2171    fn shl(self, rhs: &u16) -> Self {
2172        self.shl(*rhs)
2173    }
2174}
2175
2176impl Shl<&u16> for &USizeVec2 {
2177    type Output = USizeVec2;
2178    #[inline]
2179    fn shl(self, rhs: &u16) -> USizeVec2 {
2180        (*self).shl(*rhs)
2181    }
2182}
2183
2184impl Shl<u16> for &USizeVec2 {
2185    type Output = USizeVec2;
2186    #[inline]
2187    fn shl(self, rhs: u16) -> USizeVec2 {
2188        (*self).shl(rhs)
2189    }
2190}
2191
2192impl ShlAssign<u16> for USizeVec2 {
2193    #[inline]
2194    fn shl_assign(&mut self, rhs: u16) {
2195        *self = self.shl(rhs);
2196    }
2197}
2198
2199impl ShlAssign<&u16> for USizeVec2 {
2200    #[inline]
2201    fn shl_assign(&mut self, rhs: &u16) {
2202        self.shl_assign(*rhs);
2203    }
2204}
2205
2206impl Shr<u16> for USizeVec2 {
2207    type Output = Self;
2208    #[inline]
2209    fn shr(self, rhs: u16) -> Self::Output {
2210        Self {
2211            x: self.x.shr(rhs),
2212            y: self.y.shr(rhs),
2213        }
2214    }
2215}
2216
2217impl Shr<&u16> for USizeVec2 {
2218    type Output = Self;
2219    #[inline]
2220    fn shr(self, rhs: &u16) -> Self {
2221        self.shr(*rhs)
2222    }
2223}
2224
2225impl Shr<&u16> for &USizeVec2 {
2226    type Output = USizeVec2;
2227    #[inline]
2228    fn shr(self, rhs: &u16) -> USizeVec2 {
2229        (*self).shr(*rhs)
2230    }
2231}
2232
2233impl Shr<u16> for &USizeVec2 {
2234    type Output = USizeVec2;
2235    #[inline]
2236    fn shr(self, rhs: u16) -> USizeVec2 {
2237        (*self).shr(rhs)
2238    }
2239}
2240
2241impl ShrAssign<u16> for USizeVec2 {
2242    #[inline]
2243    fn shr_assign(&mut self, rhs: u16) {
2244        *self = self.shr(rhs);
2245    }
2246}
2247
2248impl ShrAssign<&u16> for USizeVec2 {
2249    #[inline]
2250    fn shr_assign(&mut self, rhs: &u16) {
2251        self.shr_assign(*rhs);
2252    }
2253}
2254
2255impl Shl<u32> for USizeVec2 {
2256    type Output = Self;
2257    #[inline]
2258    fn shl(self, rhs: u32) -> Self::Output {
2259        Self {
2260            x: self.x.shl(rhs),
2261            y: self.y.shl(rhs),
2262        }
2263    }
2264}
2265
2266impl Shl<&u32> for USizeVec2 {
2267    type Output = Self;
2268    #[inline]
2269    fn shl(self, rhs: &u32) -> Self {
2270        self.shl(*rhs)
2271    }
2272}
2273
2274impl Shl<&u32> for &USizeVec2 {
2275    type Output = USizeVec2;
2276    #[inline]
2277    fn shl(self, rhs: &u32) -> USizeVec2 {
2278        (*self).shl(*rhs)
2279    }
2280}
2281
2282impl Shl<u32> for &USizeVec2 {
2283    type Output = USizeVec2;
2284    #[inline]
2285    fn shl(self, rhs: u32) -> USizeVec2 {
2286        (*self).shl(rhs)
2287    }
2288}
2289
2290impl ShlAssign<u32> for USizeVec2 {
2291    #[inline]
2292    fn shl_assign(&mut self, rhs: u32) {
2293        *self = self.shl(rhs);
2294    }
2295}
2296
2297impl ShlAssign<&u32> for USizeVec2 {
2298    #[inline]
2299    fn shl_assign(&mut self, rhs: &u32) {
2300        self.shl_assign(*rhs);
2301    }
2302}
2303
2304impl Shr<u32> for USizeVec2 {
2305    type Output = Self;
2306    #[inline]
2307    fn shr(self, rhs: u32) -> Self::Output {
2308        Self {
2309            x: self.x.shr(rhs),
2310            y: self.y.shr(rhs),
2311        }
2312    }
2313}
2314
2315impl Shr<&u32> for USizeVec2 {
2316    type Output = Self;
2317    #[inline]
2318    fn shr(self, rhs: &u32) -> Self {
2319        self.shr(*rhs)
2320    }
2321}
2322
2323impl Shr<&u32> for &USizeVec2 {
2324    type Output = USizeVec2;
2325    #[inline]
2326    fn shr(self, rhs: &u32) -> USizeVec2 {
2327        (*self).shr(*rhs)
2328    }
2329}
2330
2331impl Shr<u32> for &USizeVec2 {
2332    type Output = USizeVec2;
2333    #[inline]
2334    fn shr(self, rhs: u32) -> USizeVec2 {
2335        (*self).shr(rhs)
2336    }
2337}
2338
2339impl ShrAssign<u32> for USizeVec2 {
2340    #[inline]
2341    fn shr_assign(&mut self, rhs: u32) {
2342        *self = self.shr(rhs);
2343    }
2344}
2345
2346impl ShrAssign<&u32> for USizeVec2 {
2347    #[inline]
2348    fn shr_assign(&mut self, rhs: &u32) {
2349        self.shr_assign(*rhs);
2350    }
2351}
2352
2353impl Shl<u64> for USizeVec2 {
2354    type Output = Self;
2355    #[inline]
2356    fn shl(self, rhs: u64) -> Self::Output {
2357        Self {
2358            x: self.x.shl(rhs),
2359            y: self.y.shl(rhs),
2360        }
2361    }
2362}
2363
2364impl Shl<&u64> for USizeVec2 {
2365    type Output = Self;
2366    #[inline]
2367    fn shl(self, rhs: &u64) -> Self {
2368        self.shl(*rhs)
2369    }
2370}
2371
2372impl Shl<&u64> for &USizeVec2 {
2373    type Output = USizeVec2;
2374    #[inline]
2375    fn shl(self, rhs: &u64) -> USizeVec2 {
2376        (*self).shl(*rhs)
2377    }
2378}
2379
2380impl Shl<u64> for &USizeVec2 {
2381    type Output = USizeVec2;
2382    #[inline]
2383    fn shl(self, rhs: u64) -> USizeVec2 {
2384        (*self).shl(rhs)
2385    }
2386}
2387
2388impl ShlAssign<u64> for USizeVec2 {
2389    #[inline]
2390    fn shl_assign(&mut self, rhs: u64) {
2391        *self = self.shl(rhs);
2392    }
2393}
2394
2395impl ShlAssign<&u64> for USizeVec2 {
2396    #[inline]
2397    fn shl_assign(&mut self, rhs: &u64) {
2398        self.shl_assign(*rhs);
2399    }
2400}
2401
2402impl Shr<u64> for USizeVec2 {
2403    type Output = Self;
2404    #[inline]
2405    fn shr(self, rhs: u64) -> Self::Output {
2406        Self {
2407            x: self.x.shr(rhs),
2408            y: self.y.shr(rhs),
2409        }
2410    }
2411}
2412
2413impl Shr<&u64> for USizeVec2 {
2414    type Output = Self;
2415    #[inline]
2416    fn shr(self, rhs: &u64) -> Self {
2417        self.shr(*rhs)
2418    }
2419}
2420
2421impl Shr<&u64> for &USizeVec2 {
2422    type Output = USizeVec2;
2423    #[inline]
2424    fn shr(self, rhs: &u64) -> USizeVec2 {
2425        (*self).shr(*rhs)
2426    }
2427}
2428
2429impl Shr<u64> for &USizeVec2 {
2430    type Output = USizeVec2;
2431    #[inline]
2432    fn shr(self, rhs: u64) -> USizeVec2 {
2433        (*self).shr(rhs)
2434    }
2435}
2436
2437impl ShrAssign<u64> for USizeVec2 {
2438    #[inline]
2439    fn shr_assign(&mut self, rhs: u64) {
2440        *self = self.shr(rhs);
2441    }
2442}
2443
2444impl ShrAssign<&u64> for USizeVec2 {
2445    #[inline]
2446    fn shr_assign(&mut self, rhs: &u64) {
2447        self.shr_assign(*rhs);
2448    }
2449}
2450
2451impl Shl<IVec2> for USizeVec2 {
2452    type Output = Self;
2453    #[inline]
2454    fn shl(self, rhs: IVec2) -> Self {
2455        Self {
2456            x: self.x.shl(rhs.x),
2457            y: self.y.shl(rhs.y),
2458        }
2459    }
2460}
2461
2462impl Shl<&IVec2> for USizeVec2 {
2463    type Output = Self;
2464    #[inline]
2465    fn shl(self, rhs: &IVec2) -> Self {
2466        self.shl(*rhs)
2467    }
2468}
2469
2470impl Shl<&IVec2> for &USizeVec2 {
2471    type Output = USizeVec2;
2472    #[inline]
2473    fn shl(self, rhs: &IVec2) -> USizeVec2 {
2474        (*self).shl(*rhs)
2475    }
2476}
2477
2478impl Shl<IVec2> for &USizeVec2 {
2479    type Output = USizeVec2;
2480    #[inline]
2481    fn shl(self, rhs: IVec2) -> USizeVec2 {
2482        (*self).shl(rhs)
2483    }
2484}
2485
2486impl Shr<IVec2> for USizeVec2 {
2487    type Output = Self;
2488    #[inline]
2489    fn shr(self, rhs: IVec2) -> Self {
2490        Self {
2491            x: self.x.shr(rhs.x),
2492            y: self.y.shr(rhs.y),
2493        }
2494    }
2495}
2496
2497impl Shr<&IVec2> for USizeVec2 {
2498    type Output = Self;
2499    #[inline]
2500    fn shr(self, rhs: &IVec2) -> Self {
2501        self.shr(*rhs)
2502    }
2503}
2504
2505impl Shr<&IVec2> for &USizeVec2 {
2506    type Output = USizeVec2;
2507    #[inline]
2508    fn shr(self, rhs: &IVec2) -> USizeVec2 {
2509        (*self).shr(*rhs)
2510    }
2511}
2512
2513impl Shr<IVec2> for &USizeVec2 {
2514    type Output = USizeVec2;
2515    #[inline]
2516    fn shr(self, rhs: IVec2) -> USizeVec2 {
2517        (*self).shr(rhs)
2518    }
2519}
2520
2521impl Shl<UVec2> for USizeVec2 {
2522    type Output = Self;
2523    #[inline]
2524    fn shl(self, rhs: UVec2) -> Self {
2525        Self {
2526            x: self.x.shl(rhs.x),
2527            y: self.y.shl(rhs.y),
2528        }
2529    }
2530}
2531
2532impl Shl<&UVec2> for USizeVec2 {
2533    type Output = Self;
2534    #[inline]
2535    fn shl(self, rhs: &UVec2) -> Self {
2536        self.shl(*rhs)
2537    }
2538}
2539
2540impl Shl<&UVec2> for &USizeVec2 {
2541    type Output = USizeVec2;
2542    #[inline]
2543    fn shl(self, rhs: &UVec2) -> USizeVec2 {
2544        (*self).shl(*rhs)
2545    }
2546}
2547
2548impl Shl<UVec2> for &USizeVec2 {
2549    type Output = USizeVec2;
2550    #[inline]
2551    fn shl(self, rhs: UVec2) -> USizeVec2 {
2552        (*self).shl(rhs)
2553    }
2554}
2555
2556impl Shr<UVec2> for USizeVec2 {
2557    type Output = Self;
2558    #[inline]
2559    fn shr(self, rhs: UVec2) -> Self {
2560        Self {
2561            x: self.x.shr(rhs.x),
2562            y: self.y.shr(rhs.y),
2563        }
2564    }
2565}
2566
2567impl Shr<&UVec2> for USizeVec2 {
2568    type Output = Self;
2569    #[inline]
2570    fn shr(self, rhs: &UVec2) -> Self {
2571        self.shr(*rhs)
2572    }
2573}
2574
2575impl Shr<&UVec2> for &USizeVec2 {
2576    type Output = USizeVec2;
2577    #[inline]
2578    fn shr(self, rhs: &UVec2) -> USizeVec2 {
2579        (*self).shr(*rhs)
2580    }
2581}
2582
2583impl Shr<UVec2> for &USizeVec2 {
2584    type Output = USizeVec2;
2585    #[inline]
2586    fn shr(self, rhs: UVec2) -> USizeVec2 {
2587        (*self).shr(rhs)
2588    }
2589}
2590
2591impl Index<usize> for USizeVec2 {
2592    type Output = usize;
2593    #[inline]
2594    fn index(&self, index: usize) -> &Self::Output {
2595        match index {
2596            0 => &self.x,
2597            1 => &self.y,
2598            _ => panic!("index out of bounds"),
2599        }
2600    }
2601}
2602
2603impl IndexMut<usize> for USizeVec2 {
2604    #[inline]
2605    fn index_mut(&mut self, index: usize) -> &mut Self::Output {
2606        match index {
2607            0 => &mut self.x,
2608            1 => &mut self.y,
2609            _ => panic!("index out of bounds"),
2610        }
2611    }
2612}
2613
2614impl fmt::Display for USizeVec2 {
2615    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
2616        write!(f, "[{}, {}]", self.x, self.y)
2617    }
2618}
2619
2620impl fmt::Debug for USizeVec2 {
2621    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
2622        fmt.debug_tuple(stringify!(USizeVec2))
2623            .field(&self.x)
2624            .field(&self.y)
2625            .finish()
2626    }
2627}
2628
2629impl From<[usize; 2]> for USizeVec2 {
2630    #[inline]
2631    fn from(a: [usize; 2]) -> Self {
2632        Self::new(a[0], a[1])
2633    }
2634}
2635
2636impl From<USizeVec2> for [usize; 2] {
2637    #[inline]
2638    fn from(v: USizeVec2) -> Self {
2639        [v.x, v.y]
2640    }
2641}
2642
2643impl From<(usize, usize)> for USizeVec2 {
2644    #[inline]
2645    fn from(t: (usize, usize)) -> Self {
2646        Self::new(t.0, t.1)
2647    }
2648}
2649
2650impl From<USizeVec2> for (usize, usize) {
2651    #[inline]
2652    fn from(v: USizeVec2) -> Self {
2653        (v.x, v.y)
2654    }
2655}
2656
2657impl From<U8Vec2> for USizeVec2 {
2658    #[inline]
2659    fn from(v: U8Vec2) -> Self {
2660        Self::new(usize::from(v.x), usize::from(v.y))
2661    }
2662}
2663
2664impl From<U16Vec2> for USizeVec2 {
2665    #[inline]
2666    fn from(v: U16Vec2) -> Self {
2667        Self::new(usize::from(v.x), usize::from(v.y))
2668    }
2669}
2670
2671impl TryFrom<I8Vec2> for USizeVec2 {
2672    type Error = core::num::TryFromIntError;
2673
2674    #[inline]
2675    fn try_from(v: I8Vec2) -> Result<Self, Self::Error> {
2676        Ok(Self::new(usize::try_from(v.x)?, usize::try_from(v.y)?))
2677    }
2678}
2679
2680impl TryFrom<I16Vec2> for USizeVec2 {
2681    type Error = core::num::TryFromIntError;
2682
2683    #[inline]
2684    fn try_from(v: I16Vec2) -> Result<Self, Self::Error> {
2685        Ok(Self::new(usize::try_from(v.x)?, usize::try_from(v.y)?))
2686    }
2687}
2688
2689impl TryFrom<IVec2> for USizeVec2 {
2690    type Error = core::num::TryFromIntError;
2691
2692    #[inline]
2693    fn try_from(v: IVec2) -> Result<Self, Self::Error> {
2694        Ok(Self::new(usize::try_from(v.x)?, usize::try_from(v.y)?))
2695    }
2696}
2697
2698impl TryFrom<I64Vec2> for USizeVec2 {
2699    type Error = core::num::TryFromIntError;
2700
2701    #[inline]
2702    fn try_from(v: I64Vec2) -> Result<Self, Self::Error> {
2703        Ok(Self::new(usize::try_from(v.x)?, usize::try_from(v.y)?))
2704    }
2705}
2706
2707impl TryFrom<UVec2> for USizeVec2 {
2708    type Error = core::num::TryFromIntError;
2709
2710    #[inline]
2711    fn try_from(v: UVec2) -> Result<Self, Self::Error> {
2712        Ok(Self::new(usize::try_from(v.x)?, usize::try_from(v.y)?))
2713    }
2714}
2715
2716impl TryFrom<U64Vec2> for USizeVec2 {
2717    type Error = core::num::TryFromIntError;
2718
2719    #[inline]
2720    fn try_from(v: U64Vec2) -> Result<Self, Self::Error> {
2721        Ok(Self::new(usize::try_from(v.x)?, usize::try_from(v.y)?))
2722    }
2723}
2724
2725impl From<BVec2> for USizeVec2 {
2726    #[inline]
2727    fn from(v: BVec2) -> Self {
2728        Self::new(usize::from(v.x), usize::from(v.y))
2729    }
2730}