• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

bitshifter / glam-rs / 21560716727

01 Feb 2026 09:46AM UTC coverage: 97.127% (+0.04%) from 97.086%
21560716727

Pull #712

github

bitshifter
More missing tests.
Pull Request #712: Add ISizeVecN types

4031 of 4126 new or added lines in 44 files covered. (97.7%)

1 existing line in 1 file now uncovered.

57206 of 58898 relevant lines covered (97.13%)

3.46 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

98.51
/src/usize/usizevec4.rs
1
// Generated from vec.rs.tera template. Edit the template, not the generated file.
2

3
#[cfg(not(feature = "scalar-math"))]
4
use crate::BVec4A;
5
use crate::{
6
    BVec4, I16Vec4, I64Vec4, I8Vec4, ISizeVec4, IVec4, U16Vec4, U64Vec4, U8Vec4, USizeVec2,
7
    USizeVec3, UVec4,
8
};
9

10
use core::fmt;
11
use core::iter::{Product, Sum};
12
use core::{f32, ops::*};
13

14
#[cfg(feature = "zerocopy")]
15
use zerocopy_derive::*;
16

17
/// Creates a 4-dimensional vector.
18
#[inline(always)]
19
#[must_use]
20
pub const fn usizevec4(x: usize, y: usize, z: usize, w: usize) -> USizeVec4 {
6✔
21
    USizeVec4::new(x, y, z, w)
×
22
}
23

24
/// A 4-dimensional vector.
25
#[derive(Clone, Copy, PartialEq, Eq, Hash)]
26
#[cfg_attr(feature = "bytemuck", derive(bytemuck::Pod, bytemuck::Zeroable))]
27
#[cfg_attr(
28
    feature = "zerocopy",
29
    derive(FromBytes, Immutable, IntoBytes, KnownLayout)
30
)]
31
#[cfg_attr(feature = "cuda", repr(align(16)))]
32
#[repr(C)]
33
#[cfg_attr(target_arch = "spirv", rust_gpu::vector::v1)]
34
pub struct USizeVec4 {
35
    pub x: usize,
36
    pub y: usize,
37
    pub z: usize,
38
    pub w: usize,
39
}
40

41
impl USizeVec4 {
42
    /// All zeroes.
43
    pub const ZERO: Self = Self::splat(0);
44

45
    /// All ones.
46
    pub const ONE: Self = Self::splat(1);
47

48
    /// All `usize::MIN`.
49
    pub const MIN: Self = Self::splat(usize::MIN);
50

51
    /// All `usize::MAX`.
52
    pub const MAX: Self = Self::splat(usize::MAX);
53

54
    /// A unit vector pointing along the positive X axis.
55
    pub const X: Self = Self::new(1, 0, 0, 0);
56

57
    /// A unit vector pointing along the positive Y axis.
58
    pub const Y: Self = Self::new(0, 1, 0, 0);
59

60
    /// A unit vector pointing along the positive Z axis.
61
    pub const Z: Self = Self::new(0, 0, 1, 0);
62

63
    /// A unit vector pointing along the positive W axis.
64
    pub const W: Self = Self::new(0, 0, 0, 1);
65

66
    /// The unit axes.
67
    pub const AXES: [Self; 4] = [Self::X, Self::Y, Self::Z, Self::W];
68

69
    /// Creates a new vector.
70
    #[inline(always)]
71
    #[must_use]
72
    pub const fn new(x: usize, y: usize, z: usize, w: usize) -> Self {
12✔
73
        Self { x, y, z, w }
74
    }
75

76
    /// Creates a vector with all elements set to `v`.
77
    #[inline]
78
    #[must_use]
79
    pub const fn splat(v: usize) -> Self {
3✔
80
        Self {
81
            x: v,
82

83
            y: v,
84

85
            z: v,
86

87
            w: v,
88
        }
89
    }
90

91
    /// Returns a vector containing each element of `self` modified by a mapping function `f`.
92
    #[inline]
93
    #[must_use]
94
    pub fn map<F>(self, f: F) -> Self
6✔
95
    where
96
        F: Fn(usize) -> usize,
97
    {
98
        Self::new(f(self.x), f(self.y), f(self.z), f(self.w))
12✔
99
    }
100

101
    /// Creates a vector from the elements in `if_true` and `if_false`, selecting which to use
102
    /// for each element of `self`.
103
    ///
104
    /// A true element in the mask uses the corresponding element from `if_true`, and false
105
    /// uses the element from `if_false`.
106
    #[inline]
107
    #[must_use]
108
    pub fn select(mask: BVec4, if_true: Self, if_false: Self) -> Self {
3✔
109
        Self {
110
            x: if mask.test(0) { if_true.x } else { if_false.x },
3✔
111
            y: if mask.test(1) { if_true.y } else { if_false.y },
3✔
112
            z: if mask.test(2) { if_true.z } else { if_false.z },
3✔
113
            w: if mask.test(3) { if_true.w } else { if_false.w },
3✔
114
        }
115
    }
116

117
    /// Creates a new vector from an array.
118
    #[inline]
119
    #[must_use]
120
    pub const fn from_array(a: [usize; 4]) -> Self {
×
121
        Self::new(a[0], a[1], a[2], a[3])
×
122
    }
123

124
    /// Converts `self` to `[x, y, z, w]`
125
    #[inline]
126
    #[must_use]
127
    pub const fn to_array(&self) -> [usize; 4] {
3✔
128
        [self.x, self.y, self.z, self.w]
3✔
129
    }
130

131
    /// Creates a vector from the first 4 values in `slice`.
132
    ///
133
    /// # Panics
134
    ///
135
    /// Panics if `slice` is less than 4 elements long.
136
    #[inline]
137
    #[must_use]
138
    pub const fn from_slice(slice: &[usize]) -> Self {
3✔
139
        assert!(slice.len() >= 4);
3✔
140
        Self::new(slice[0], slice[1], slice[2], slice[3])
3✔
141
    }
142

143
    /// Writes the elements of `self` to the first 4 elements in `slice`.
144
    ///
145
    /// # Panics
146
    ///
147
    /// Panics if `slice` is less than 4 elements long.
148
    #[inline]
149
    pub fn write_to_slice(self, slice: &mut [usize]) {
3✔
150
        slice[..4].copy_from_slice(&self.to_array());
3✔
151
    }
152

153
    /// Creates a 3D vector from the `x`, `y` and `z` elements of `self`, discarding `w`.
154
    ///
155
    /// Truncation to [`USizeVec3`] may also be performed by using [`self.xyz()`][crate::swizzles::Vec4Swizzles::xyz()].
156
    #[inline]
157
    #[must_use]
158
    pub fn truncate(self) -> USizeVec3 {
6✔
159
        use crate::swizzles::Vec4Swizzles;
160
        self.xyz()
6✔
161
    }
162

163
    /// Creates a 4D vector from `self` with the given value of `x`.
164
    #[inline]
165
    #[must_use]
166
    pub fn with_x(mut self, x: usize) -> Self {
3✔
167
        self.x = x;
3✔
168
        self
3✔
169
    }
170

171
    /// Creates a 4D vector from `self` with the given value of `y`.
172
    #[inline]
173
    #[must_use]
174
    pub fn with_y(mut self, y: usize) -> Self {
3✔
175
        self.y = y;
3✔
176
        self
3✔
177
    }
178

179
    /// Creates a 4D vector from `self` with the given value of `z`.
180
    #[inline]
181
    #[must_use]
182
    pub fn with_z(mut self, z: usize) -> Self {
3✔
183
        self.z = z;
3✔
184
        self
3✔
185
    }
186

187
    /// Creates a 4D vector from `self` with the given value of `w`.
188
    #[inline]
189
    #[must_use]
190
    pub fn with_w(mut self, w: usize) -> Self {
3✔
191
        self.w = w;
3✔
192
        self
3✔
193
    }
194

195
    /// Computes the dot product of `self` and `rhs`.
196
    #[inline]
197
    #[must_use]
198
    pub fn dot(self, rhs: Self) -> usize {
3✔
199
        (self.x * rhs.x) + (self.y * rhs.y) + (self.z * rhs.z) + (self.w * rhs.w)
3✔
200
    }
201

202
    /// Returns a vector where every component is the dot product of `self` and `rhs`.
203
    #[inline]
204
    #[must_use]
205
    pub fn dot_into_vec(self, rhs: Self) -> Self {
3✔
206
        Self::splat(self.dot(rhs))
3✔
207
    }
208

209
    /// Returns a vector containing the minimum values for each element of `self` and `rhs`.
210
    ///
211
    /// In other words this computes `[min(x, rhs.x), min(self.y, rhs.y), ..]`.
212
    #[inline]
213
    #[must_use]
214
    pub fn min(self, rhs: Self) -> Self {
3✔
215
        Self {
216
            x: if self.x < rhs.x { self.x } else { rhs.x },
3✔
217
            y: if self.y < rhs.y { self.y } else { rhs.y },
3✔
218
            z: if self.z < rhs.z { self.z } else { rhs.z },
3✔
219
            w: if self.w < rhs.w { self.w } else { rhs.w },
3✔
220
        }
221
    }
222

223
    /// Returns a vector containing the maximum values for each element of `self` and `rhs`.
224
    ///
225
    /// In other words this computes `[max(self.x, rhs.x), max(self.y, rhs.y), ..]`.
226
    #[inline]
227
    #[must_use]
228
    pub fn max(self, rhs: Self) -> Self {
3✔
229
        Self {
230
            x: if self.x > rhs.x { self.x } else { rhs.x },
3✔
231
            y: if self.y > rhs.y { self.y } else { rhs.y },
3✔
232
            z: if self.z > rhs.z { self.z } else { rhs.z },
3✔
233
            w: if self.w > rhs.w { self.w } else { rhs.w },
3✔
234
        }
235
    }
236

237
    /// Component-wise clamping of values, similar to [`usize::clamp`].
238
    ///
239
    /// Each element in `min` must be less-or-equal to the corresponding element in `max`.
240
    ///
241
    /// # Panics
242
    ///
243
    /// Will panic if `min` is greater than `max` when `glam_assert` is enabled.
244
    #[inline]
245
    #[must_use]
246
    pub fn clamp(self, min: Self, max: Self) -> Self {
3✔
247
        glam_assert!(min.cmple(max).all(), "clamp: expected min <= max");
3✔
248
        self.max(min).min(max)
3✔
249
    }
250

251
    /// Returns the horizontal minimum of `self`.
252
    ///
253
    /// In other words this computes `min(x, y, ..)`.
254
    #[inline]
255
    #[must_use]
256
    pub fn min_element(self) -> usize {
3✔
257
        let min = |a, b| if a < b { a } else { b };
6✔
258
        min(self.x, min(self.y, min(self.z, self.w)))
3✔
259
    }
260

261
    /// Returns the horizontal maximum of `self`.
262
    ///
263
    /// In other words this computes `max(x, y, ..)`.
264
    #[inline]
265
    #[must_use]
266
    pub fn max_element(self) -> usize {
3✔
267
        let max = |a, b| if a > b { a } else { b };
6✔
268
        max(self.x, max(self.y, max(self.z, self.w)))
3✔
269
    }
270

271
    /// Returns the index of the first minimum element of `self`.
272
    #[doc(alias = "argmin")]
273
    #[inline]
274
    #[must_use]
275
    pub fn min_position(self) -> usize {
3✔
276
        let mut min = self.x;
3✔
277
        let mut index = 0;
3✔
278
        if self.y < min {
6✔
279
            min = self.y;
3✔
280
            index = 1;
3✔
281
        }
282
        if self.z < min {
6✔
283
            min = self.z;
3✔
284
            index = 2;
3✔
285
        }
286
        if self.w < min {
6✔
287
            index = 3;
3✔
288
        }
289
        index
3✔
290
    }
291

292
    /// Returns the index of the first maximum element of `self`.
293
    #[doc(alias = "argmax")]
294
    #[inline]
295
    #[must_use]
296
    pub fn max_position(self) -> usize {
3✔
297
        let mut max = self.x;
3✔
298
        let mut index = 0;
3✔
299
        if self.y > max {
6✔
300
            max = self.y;
3✔
301
            index = 1;
3✔
302
        }
303
        if self.z > max {
6✔
304
            max = self.z;
3✔
305
            index = 2;
3✔
306
        }
307
        if self.w > max {
6✔
308
            index = 3;
3✔
309
        }
310
        index
3✔
311
    }
312

313
    /// Returns the sum of all elements of `self`.
314
    ///
315
    /// In other words, this computes `self.x + self.y + ..`.
316
    #[inline]
317
    #[must_use]
318
    pub fn element_sum(self) -> usize {
3✔
319
        self.x + self.y + self.z + self.w
3✔
320
    }
321

322
    /// Returns the product of all elements of `self`.
323
    ///
324
    /// In other words, this computes `self.x * self.y * ..`.
325
    #[inline]
326
    #[must_use]
327
    pub fn element_product(self) -> usize {
3✔
328
        self.x * self.y * self.z * self.w
3✔
329
    }
330

331
    /// Returns a vector mask containing the result of a `==` comparison for each element of
332
    /// `self` and `rhs`.
333
    ///
334
    /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all
335
    /// elements.
336
    #[inline]
337
    #[must_use]
338
    pub fn cmpeq(self, rhs: Self) -> BVec4 {
3✔
339
        BVec4::new(
340
            self.x.eq(&rhs.x),
3✔
341
            self.y.eq(&rhs.y),
3✔
342
            self.z.eq(&rhs.z),
3✔
343
            self.w.eq(&rhs.w),
3✔
344
        )
345
    }
346

347
    /// Returns a vector mask containing the result of a `!=` comparison for each element of
348
    /// `self` and `rhs`.
349
    ///
350
    /// In other words this computes `[self.x != rhs.x, self.y != rhs.y, ..]` for all
351
    /// elements.
352
    #[inline]
353
    #[must_use]
354
    pub fn cmpne(self, rhs: Self) -> BVec4 {
3✔
355
        BVec4::new(
356
            self.x.ne(&rhs.x),
3✔
357
            self.y.ne(&rhs.y),
4✔
358
            self.z.ne(&rhs.z),
4✔
359
            self.w.ne(&rhs.w),
4✔
360
        )
361
    }
362

363
    /// Returns a vector mask containing the result of a `>=` comparison for each element of
364
    /// `self` and `rhs`.
365
    ///
366
    /// In other words this computes `[self.x >= rhs.x, self.y >= rhs.y, ..]` for all
367
    /// elements.
368
    #[inline]
369
    #[must_use]
370
    pub fn cmpge(self, rhs: Self) -> BVec4 {
3✔
371
        BVec4::new(
372
            self.x.ge(&rhs.x),
3✔
373
            self.y.ge(&rhs.y),
3✔
374
            self.z.ge(&rhs.z),
3✔
375
            self.w.ge(&rhs.w),
3✔
376
        )
377
    }
378

379
    /// Returns a vector mask containing the result of a `>` comparison for each element of
380
    /// `self` and `rhs`.
381
    ///
382
    /// In other words this computes `[self.x > rhs.x, self.y > rhs.y, ..]` for all
383
    /// elements.
384
    #[inline]
385
    #[must_use]
386
    pub fn cmpgt(self, rhs: Self) -> BVec4 {
3✔
387
        BVec4::new(
388
            self.x.gt(&rhs.x),
3✔
389
            self.y.gt(&rhs.y),
3✔
390
            self.z.gt(&rhs.z),
3✔
391
            self.w.gt(&rhs.w),
3✔
392
        )
393
    }
394

395
    /// Returns a vector mask containing the result of a `<=` comparison for each element of
396
    /// `self` and `rhs`.
397
    ///
398
    /// In other words this computes `[self.x <= rhs.x, self.y <= rhs.y, ..]` for all
399
    /// elements.
400
    #[inline]
401
    #[must_use]
402
    pub fn cmple(self, rhs: Self) -> BVec4 {
3✔
403
        BVec4::new(
404
            self.x.le(&rhs.x),
3✔
405
            self.y.le(&rhs.y),
3✔
406
            self.z.le(&rhs.z),
3✔
407
            self.w.le(&rhs.w),
3✔
408
        )
409
    }
410

411
    /// Returns a vector mask containing the result of a `<` comparison for each element of
412
    /// `self` and `rhs`.
413
    ///
414
    /// In other words this computes `[self.x < rhs.x, self.y < rhs.y, ..]` for all
415
    /// elements.
416
    #[inline]
417
    #[must_use]
418
    pub fn cmplt(self, rhs: Self) -> BVec4 {
3✔
419
        BVec4::new(
420
            self.x.lt(&rhs.x),
3✔
421
            self.y.lt(&rhs.y),
3✔
422
            self.z.lt(&rhs.z),
3✔
423
            self.w.lt(&rhs.w),
3✔
424
        )
425
    }
426

427
    /// Computes the squared length of `self`.
428
    #[doc(alias = "magnitude2")]
429
    #[inline]
430
    #[must_use]
431
    pub fn length_squared(self) -> usize {
3✔
432
        self.dot(self)
3✔
433
    }
434

435
    /// Computes the [manhattan distance] between two points.
436
    ///
437
    /// # Overflow
438
    /// This method may overflow if the result is greater than [`usize::MAX`].
439
    ///
440
    /// See also [`checked_manhattan_distance`][USizeVec4::checked_manhattan_distance].
441
    ///
442
    /// [manhattan distance]: https://en.wikipedia.org/wiki/Taxicab_geometry
443
    #[inline]
444
    #[must_use]
445
    pub fn manhattan_distance(self, rhs: Self) -> usize {
3✔
446
        self.x.abs_diff(rhs.x)
12✔
447
            + self.y.abs_diff(rhs.y)
3✔
448
            + self.z.abs_diff(rhs.z)
3✔
449
            + self.w.abs_diff(rhs.w)
3✔
450
    }
451

452
    /// Computes the [manhattan distance] between two points.
453
    ///
454
    /// This will returns [`None`] if the result is greater than [`usize::MAX`].
455
    ///
456
    /// [manhattan distance]: https://en.wikipedia.org/wiki/Taxicab_geometry
457
    #[inline]
458
    #[must_use]
459
    pub fn checked_manhattan_distance(self, rhs: Self) -> Option<usize> {
3✔
460
        let d = self.x.abs_diff(rhs.x);
3✔
461
        let d = d.checked_add(self.y.abs_diff(rhs.y))?;
3✔
462
        let d = d.checked_add(self.z.abs_diff(rhs.z))?;
3✔
463
        d.checked_add(self.w.abs_diff(rhs.w))
3✔
464
    }
465

466
    /// Computes the [chebyshev distance] between two points.
467
    ///
468
    /// [chebyshev distance]: https://en.wikipedia.org/wiki/Chebyshev_distance
469
    #[inline]
470
    #[must_use]
471
    pub fn chebyshev_distance(self, rhs: Self) -> usize {
3✔
472
        // Note: the compiler will eventually optimize out the loop
473
        [
474
            self.x.abs_diff(rhs.x),
3✔
475
            self.y.abs_diff(rhs.y),
3✔
476
            self.z.abs_diff(rhs.z),
3✔
477
            self.w.abs_diff(rhs.w),
3✔
478
        ]
479
        .into_iter()
480
        .max()
481
        .unwrap()
482
    }
483

484
    /// Casts all elements of `self` to `f32`.
485
    #[inline]
486
    #[must_use]
487
    pub fn as_vec4(self) -> crate::Vec4 {
3✔
488
        crate::Vec4::new(self.x as f32, self.y as f32, self.z as f32, self.w as f32)
3✔
489
    }
490

491
    /// Casts all elements of `self` to `f64`.
492
    #[inline]
493
    #[must_use]
494
    pub fn as_dvec4(self) -> crate::DVec4 {
3✔
495
        crate::DVec4::new(self.x as f64, self.y as f64, self.z as f64, self.w as f64)
3✔
496
    }
497

498
    /// Casts all elements of `self` to `i8`.
499
    #[inline]
500
    #[must_use]
501
    pub fn as_i8vec4(self) -> crate::I8Vec4 {
3✔
502
        crate::I8Vec4::new(self.x as i8, self.y as i8, self.z as i8, self.w as i8)
3✔
503
    }
504

505
    /// Casts all elements of `self` to `u8`.
506
    #[inline]
507
    #[must_use]
508
    pub fn as_u8vec4(self) -> crate::U8Vec4 {
3✔
509
        crate::U8Vec4::new(self.x as u8, self.y as u8, self.z as u8, self.w as u8)
3✔
510
    }
511

512
    /// Casts all elements of `self` to `i16`.
513
    #[inline]
514
    #[must_use]
515
    pub fn as_i16vec4(self) -> crate::I16Vec4 {
3✔
516
        crate::I16Vec4::new(self.x as i16, self.y as i16, self.z as i16, self.w as i16)
3✔
517
    }
518

519
    /// Casts all elements of `self` to `u16`.
520
    #[inline]
521
    #[must_use]
522
    pub fn as_u16vec4(self) -> crate::U16Vec4 {
3✔
523
        crate::U16Vec4::new(self.x as u16, self.y as u16, self.z as u16, self.w as u16)
3✔
524
    }
525

526
    /// Casts all elements of `self` to `i32`.
527
    #[inline]
528
    #[must_use]
529
    pub fn as_ivec4(self) -> crate::IVec4 {
3✔
530
        crate::IVec4::new(self.x as i32, self.y as i32, self.z as i32, self.w as i32)
3✔
531
    }
532

533
    /// Casts all elements of `self` to `u32`.
534
    #[inline]
535
    #[must_use]
536
    pub fn as_uvec4(self) -> crate::UVec4 {
3✔
537
        crate::UVec4::new(self.x as u32, self.y as u32, self.z as u32, self.w as u32)
3✔
538
    }
539

540
    /// Casts all elements of `self` to `i64`.
541
    #[inline]
542
    #[must_use]
543
    pub fn as_i64vec4(self) -> crate::I64Vec4 {
3✔
544
        crate::I64Vec4::new(self.x as i64, self.y as i64, self.z as i64, self.w as i64)
3✔
545
    }
546

547
    /// Casts all elements of `self` to `u64`.
548
    #[inline]
549
    #[must_use]
550
    pub fn as_u64vec4(self) -> crate::U64Vec4 {
3✔
551
        crate::U64Vec4::new(self.x as u64, self.y as u64, self.z as u64, self.w as u64)
3✔
552
    }
553

554
    /// Casts all elements of `self` to `isize`.
555
    #[inline]
556
    #[must_use]
557
    pub fn as_isizevec4(self) -> crate::ISizeVec4 {
3✔
558
        crate::ISizeVec4::new(
559
            self.x as isize,
3✔
560
            self.y as isize,
3✔
561
            self.z as isize,
3✔
562
            self.w as isize,
3✔
563
        )
564
    }
565

566
    /// Returns a vector containing the wrapping addition of `self` and `rhs`.
567
    ///
568
    /// In other words this computes `Some([self.x + rhs.x, self.y + rhs.y, ..])` but returns `None` on any overflow.
569
    #[inline]
570
    #[must_use]
571
    pub const fn checked_add(self, rhs: Self) -> Option<Self> {
3✔
572
        let x = match self.x.checked_add(rhs.x) {
3✔
573
            Some(v) => v,
3✔
574
            None => return None,
3✔
575
        };
576
        let y = match self.y.checked_add(rhs.y) {
3✔
577
            Some(v) => v,
3✔
578
            None => return None,
3✔
579
        };
580
        let z = match self.z.checked_add(rhs.z) {
3✔
581
            Some(v) => v,
3✔
582
            None => return None,
3✔
583
        };
584
        let w = match self.w.checked_add(rhs.w) {
3✔
585
            Some(v) => v,
3✔
586
            None => return None,
3✔
587
        };
588

589
        Some(Self { x, y, z, w })
3✔
590
    }
591

592
    /// Returns a vector containing the wrapping subtraction of `self` and `rhs`.
593
    ///
594
    /// In other words this computes `Some([self.x - rhs.x, self.y - rhs.y, ..])` but returns `None` on any overflow.
595
    #[inline]
596
    #[must_use]
597
    pub const fn checked_sub(self, rhs: Self) -> Option<Self> {
3✔
598
        let x = match self.x.checked_sub(rhs.x) {
3✔
599
            Some(v) => v,
3✔
600
            None => return None,
3✔
601
        };
602
        let y = match self.y.checked_sub(rhs.y) {
3✔
603
            Some(v) => v,
3✔
604
            None => return None,
3✔
605
        };
606
        let z = match self.z.checked_sub(rhs.z) {
3✔
607
            Some(v) => v,
3✔
608
            None => return None,
3✔
609
        };
610
        let w = match self.w.checked_sub(rhs.w) {
3✔
611
            Some(v) => v,
3✔
612
            None => return None,
3✔
613
        };
614

615
        Some(Self { x, y, z, w })
3✔
616
    }
617

618
    /// Returns a vector containing the wrapping multiplication of `self` and `rhs`.
619
    ///
620
    /// In other words this computes `Some([self.x * rhs.x, self.y * rhs.y, ..])` but returns `None` on any overflow.
621
    #[inline]
622
    #[must_use]
623
    pub const fn checked_mul(self, rhs: Self) -> Option<Self> {
3✔
624
        let x = match self.x.checked_mul(rhs.x) {
3✔
625
            Some(v) => v,
3✔
626
            None => return None,
3✔
627
        };
628
        let y = match self.y.checked_mul(rhs.y) {
3✔
629
            Some(v) => v,
3✔
630
            None => return None,
×
631
        };
632
        let z = match self.z.checked_mul(rhs.z) {
3✔
633
            Some(v) => v,
3✔
634
            None => return None,
×
635
        };
636
        let w = match self.w.checked_mul(rhs.w) {
3✔
637
            Some(v) => v,
3✔
638
            None => return None,
×
639
        };
640

641
        Some(Self { x, y, z, w })
3✔
642
    }
643

644
    /// Returns a vector containing the wrapping division of `self` and `rhs`.
645
    ///
646
    /// In other words this computes `Some([self.x / rhs.x, self.y / rhs.y, ..])` but returns `None` on any division by zero.
647
    #[inline]
648
    #[must_use]
649
    pub const fn checked_div(self, rhs: Self) -> Option<Self> {
3✔
650
        let x = match self.x.checked_div(rhs.x) {
3✔
651
            Some(v) => v,
3✔
652
            None => return None,
3✔
653
        };
654
        let y = match self.y.checked_div(rhs.y) {
3✔
655
            Some(v) => v,
3✔
656
            None => return None,
3✔
657
        };
658
        let z = match self.z.checked_div(rhs.z) {
3✔
659
            Some(v) => v,
3✔
660
            None => return None,
×
661
        };
662
        let w = match self.w.checked_div(rhs.w) {
3✔
663
            Some(v) => v,
3✔
664
            None => return None,
×
665
        };
666

667
        Some(Self { x, y, z, w })
3✔
668
    }
669

670
    /// Returns a vector containing the wrapping addition of `self` and `rhs`.
671
    ///
672
    /// In other words this computes `[self.x.wrapping_add(rhs.x), self.y.wrapping_add(rhs.y), ..]`.
673
    #[inline]
674
    #[must_use]
675
    pub const fn wrapping_add(self, rhs: Self) -> Self {
3✔
676
        Self {
677
            x: self.x.wrapping_add(rhs.x),
3✔
678
            y: self.y.wrapping_add(rhs.y),
3✔
679
            z: self.z.wrapping_add(rhs.z),
3✔
680
            w: self.w.wrapping_add(rhs.w),
3✔
681
        }
682
    }
683

684
    /// Returns a vector containing the wrapping subtraction of `self` and `rhs`.
685
    ///
686
    /// In other words this computes `[self.x.wrapping_sub(rhs.x), self.y.wrapping_sub(rhs.y), ..]`.
687
    #[inline]
688
    #[must_use]
689
    pub const fn wrapping_sub(self, rhs: Self) -> Self {
3✔
690
        Self {
691
            x: self.x.wrapping_sub(rhs.x),
3✔
692
            y: self.y.wrapping_sub(rhs.y),
3✔
693
            z: self.z.wrapping_sub(rhs.z),
3✔
694
            w: self.w.wrapping_sub(rhs.w),
3✔
695
        }
696
    }
697

698
    /// Returns a vector containing the wrapping multiplication of `self` and `rhs`.
699
    ///
700
    /// In other words this computes `[self.x.wrapping_mul(rhs.x), self.y.wrapping_mul(rhs.y), ..]`.
701
    #[inline]
702
    #[must_use]
703
    pub const fn wrapping_mul(self, rhs: Self) -> Self {
3✔
704
        Self {
705
            x: self.x.wrapping_mul(rhs.x),
3✔
706
            y: self.y.wrapping_mul(rhs.y),
3✔
707
            z: self.z.wrapping_mul(rhs.z),
3✔
708
            w: self.w.wrapping_mul(rhs.w),
3✔
709
        }
710
    }
711

712
    /// Returns a vector containing the wrapping division of `self` and `rhs`.
713
    ///
714
    /// In other words this computes `[self.x.wrapping_div(rhs.x), self.y.wrapping_div(rhs.y), ..]`.
715
    #[inline]
716
    #[must_use]
717
    pub const fn wrapping_div(self, rhs: Self) -> Self {
3✔
718
        Self {
719
            x: self.x.wrapping_div(rhs.x),
3✔
720
            y: self.y.wrapping_div(rhs.y),
3✔
721
            z: self.z.wrapping_div(rhs.z),
3✔
722
            w: self.w.wrapping_div(rhs.w),
3✔
723
        }
724
    }
725

726
    /// Returns a vector containing the saturating addition of `self` and `rhs`.
727
    ///
728
    /// In other words this computes `[self.x.saturating_add(rhs.x), self.y.saturating_add(rhs.y), ..]`.
729
    #[inline]
730
    #[must_use]
731
    pub const fn saturating_add(self, rhs: Self) -> Self {
3✔
732
        Self {
733
            x: self.x.saturating_add(rhs.x),
3✔
734
            y: self.y.saturating_add(rhs.y),
3✔
735
            z: self.z.saturating_add(rhs.z),
3✔
736
            w: self.w.saturating_add(rhs.w),
3✔
737
        }
738
    }
739

740
    /// Returns a vector containing the saturating subtraction of `self` and `rhs`.
741
    ///
742
    /// In other words this computes `[self.x.saturating_sub(rhs.x), self.y.saturating_sub(rhs.y), ..]`.
743
    #[inline]
744
    #[must_use]
745
    pub const fn saturating_sub(self, rhs: Self) -> Self {
3✔
746
        Self {
747
            x: self.x.saturating_sub(rhs.x),
3✔
748
            y: self.y.saturating_sub(rhs.y),
3✔
749
            z: self.z.saturating_sub(rhs.z),
3✔
750
            w: self.w.saturating_sub(rhs.w),
3✔
751
        }
752
    }
753

754
    /// Returns a vector containing the saturating multiplication of `self` and `rhs`.
755
    ///
756
    /// In other words this computes `[self.x.saturating_mul(rhs.x), self.y.saturating_mul(rhs.y), ..]`.
757
    #[inline]
758
    #[must_use]
759
    pub const fn saturating_mul(self, rhs: Self) -> Self {
3✔
760
        Self {
761
            x: self.x.saturating_mul(rhs.x),
3✔
762
            y: self.y.saturating_mul(rhs.y),
3✔
763
            z: self.z.saturating_mul(rhs.z),
3✔
764
            w: self.w.saturating_mul(rhs.w),
3✔
765
        }
766
    }
767

768
    /// Returns a vector containing the saturating division of `self` and `rhs`.
769
    ///
770
    /// In other words this computes `[self.x.saturating_div(rhs.x), self.y.saturating_div(rhs.y), ..]`.
771
    #[inline]
772
    #[must_use]
773
    pub const fn saturating_div(self, rhs: Self) -> Self {
3✔
774
        Self {
775
            x: self.x.saturating_div(rhs.x),
3✔
776
            y: self.y.saturating_div(rhs.y),
3✔
777
            z: self.z.saturating_div(rhs.z),
3✔
778
            w: self.w.saturating_div(rhs.w),
3✔
779
        }
780
    }
781

782
    /// Returns a vector containing the wrapping addition of `self` and signed vector `rhs`.
783
    ///
784
    /// In other words this computes `Some([self.x + rhs.x, self.y + rhs.y, ..])` but returns `None` on any overflow.
785
    #[inline]
786
    #[must_use]
787
    pub const fn checked_add_signed(self, rhs: ISizeVec4) -> Option<Self> {
3✔
788
        let x = match self.x.checked_add_signed(rhs.x) {
3✔
789
            Some(v) => v,
3✔
790
            None => return None,
3✔
791
        };
792
        let y = match self.y.checked_add_signed(rhs.y) {
3✔
793
            Some(v) => v,
3✔
NEW
794
            None => return None,
×
795
        };
796
        let z = match self.z.checked_add_signed(rhs.z) {
3✔
797
            Some(v) => v,
3✔
NEW
798
            None => return None,
×
799
        };
800
        let w = match self.w.checked_add_signed(rhs.w) {
3✔
801
            Some(v) => v,
3✔
NEW
802
            None => return None,
×
803
        };
804

805
        Some(Self { x, y, z, w })
3✔
806
    }
807

808
    /// Returns a vector containing the wrapping addition of `self` and signed vector `rhs`.
809
    ///
810
    /// In other words this computes `[self.x.wrapping_add_signed(rhs.x), self.y.wrapping_add_signed(rhs.y), ..]`.
811
    #[inline]
812
    #[must_use]
813
    pub const fn wrapping_add_signed(self, rhs: ISizeVec4) -> Self {
3✔
814
        Self {
815
            x: self.x.wrapping_add_signed(rhs.x),
3✔
816
            y: self.y.wrapping_add_signed(rhs.y),
3✔
817
            z: self.z.wrapping_add_signed(rhs.z),
3✔
818
            w: self.w.wrapping_add_signed(rhs.w),
3✔
819
        }
820
    }
821

822
    /// Returns a vector containing the saturating addition of `self` and signed vector `rhs`.
823
    ///
824
    /// In other words this computes `[self.x.saturating_add_signed(rhs.x), self.y.saturating_add_signed(rhs.y), ..]`.
825
    #[inline]
826
    #[must_use]
827
    pub const fn saturating_add_signed(self, rhs: ISizeVec4) -> Self {
3✔
828
        Self {
829
            x: self.x.saturating_add_signed(rhs.x),
3✔
830
            y: self.y.saturating_add_signed(rhs.y),
3✔
831
            z: self.z.saturating_add_signed(rhs.z),
3✔
832
            w: self.w.saturating_add_signed(rhs.w),
3✔
833
        }
834
    }
835
}
836

837
impl Default for USizeVec4 {
838
    #[inline(always)]
839
    fn default() -> Self {
3✔
840
        Self::ZERO
3✔
841
    }
842
}
843

844
impl Div for USizeVec4 {
845
    type Output = Self;
846
    #[inline]
847
    fn div(self, rhs: Self) -> Self {
3✔
848
        Self {
849
            x: self.x.div(rhs.x),
3✔
850
            y: self.y.div(rhs.y),
3✔
851
            z: self.z.div(rhs.z),
3✔
852
            w: self.w.div(rhs.w),
3✔
853
        }
854
    }
855
}
856

857
impl Div<&Self> for USizeVec4 {
858
    type Output = Self;
859
    #[inline]
860
    fn div(self, rhs: &Self) -> Self {
3✔
861
        self.div(*rhs)
3✔
862
    }
863
}
864

865
impl Div<&USizeVec4> for &USizeVec4 {
866
    type Output = USizeVec4;
867
    #[inline]
868
    fn div(self, rhs: &USizeVec4) -> USizeVec4 {
3✔
869
        (*self).div(*rhs)
3✔
870
    }
871
}
872

873
impl Div<USizeVec4> for &USizeVec4 {
874
    type Output = USizeVec4;
875
    #[inline]
876
    fn div(self, rhs: USizeVec4) -> USizeVec4 {
3✔
877
        (*self).div(rhs)
3✔
878
    }
879
}
880

881
impl DivAssign for USizeVec4 {
882
    #[inline]
883
    fn div_assign(&mut self, rhs: Self) {
3✔
884
        self.x.div_assign(rhs.x);
3✔
885
        self.y.div_assign(rhs.y);
3✔
886
        self.z.div_assign(rhs.z);
3✔
887
        self.w.div_assign(rhs.w);
3✔
888
    }
889
}
890

891
impl DivAssign<&Self> for USizeVec4 {
892
    #[inline]
893
    fn div_assign(&mut self, rhs: &Self) {
3✔
894
        self.div_assign(*rhs);
3✔
895
    }
896
}
897

898
impl Div<usize> for USizeVec4 {
899
    type Output = Self;
900
    #[inline]
901
    fn div(self, rhs: usize) -> Self {
3✔
902
        Self {
903
            x: self.x.div(rhs),
3✔
904
            y: self.y.div(rhs),
3✔
905
            z: self.z.div(rhs),
3✔
906
            w: self.w.div(rhs),
3✔
907
        }
908
    }
909
}
910

911
impl Div<&usize> for USizeVec4 {
912
    type Output = Self;
913
    #[inline]
914
    fn div(self, rhs: &usize) -> Self {
3✔
915
        self.div(*rhs)
3✔
916
    }
917
}
918

919
impl Div<&usize> for &USizeVec4 {
920
    type Output = USizeVec4;
921
    #[inline]
922
    fn div(self, rhs: &usize) -> USizeVec4 {
3✔
923
        (*self).div(*rhs)
3✔
924
    }
925
}
926

927
impl Div<usize> for &USizeVec4 {
928
    type Output = USizeVec4;
929
    #[inline]
930
    fn div(self, rhs: usize) -> USizeVec4 {
3✔
931
        (*self).div(rhs)
3✔
932
    }
933
}
934

935
impl DivAssign<usize> for USizeVec4 {
936
    #[inline]
937
    fn div_assign(&mut self, rhs: usize) {
3✔
938
        self.x.div_assign(rhs);
3✔
939
        self.y.div_assign(rhs);
3✔
940
        self.z.div_assign(rhs);
3✔
941
        self.w.div_assign(rhs);
3✔
942
    }
943
}
944

945
impl DivAssign<&usize> for USizeVec4 {
946
    #[inline]
947
    fn div_assign(&mut self, rhs: &usize) {
3✔
948
        self.div_assign(*rhs);
3✔
949
    }
950
}
951

952
impl Div<USizeVec4> for usize {
953
    type Output = USizeVec4;
954
    #[inline]
955
    fn div(self, rhs: USizeVec4) -> USizeVec4 {
3✔
956
        USizeVec4 {
957
            x: self.div(rhs.x),
3✔
958
            y: self.div(rhs.y),
3✔
959
            z: self.div(rhs.z),
3✔
960
            w: self.div(rhs.w),
3✔
961
        }
962
    }
963
}
964

965
impl Div<&USizeVec4> for usize {
966
    type Output = USizeVec4;
967
    #[inline]
968
    fn div(self, rhs: &USizeVec4) -> USizeVec4 {
3✔
969
        self.div(*rhs)
3✔
970
    }
971
}
972

973
impl Div<&USizeVec4> for &usize {
974
    type Output = USizeVec4;
975
    #[inline]
976
    fn div(self, rhs: &USizeVec4) -> USizeVec4 {
3✔
977
        (*self).div(*rhs)
3✔
978
    }
979
}
980

981
impl Div<USizeVec4> for &usize {
982
    type Output = USizeVec4;
983
    #[inline]
984
    fn div(self, rhs: USizeVec4) -> USizeVec4 {
3✔
985
        (*self).div(rhs)
3✔
986
    }
987
}
988

989
impl Mul for USizeVec4 {
990
    type Output = Self;
991
    #[inline]
992
    fn mul(self, rhs: Self) -> Self {
3✔
993
        Self {
994
            x: self.x.mul(rhs.x),
3✔
995
            y: self.y.mul(rhs.y),
3✔
996
            z: self.z.mul(rhs.z),
3✔
997
            w: self.w.mul(rhs.w),
3✔
998
        }
999
    }
1000
}
1001

1002
impl Mul<&Self> for USizeVec4 {
1003
    type Output = Self;
1004
    #[inline]
1005
    fn mul(self, rhs: &Self) -> Self {
3✔
1006
        self.mul(*rhs)
3✔
1007
    }
1008
}
1009

1010
impl Mul<&USizeVec4> for &USizeVec4 {
1011
    type Output = USizeVec4;
1012
    #[inline]
1013
    fn mul(self, rhs: &USizeVec4) -> USizeVec4 {
3✔
1014
        (*self).mul(*rhs)
3✔
1015
    }
1016
}
1017

1018
impl Mul<USizeVec4> for &USizeVec4 {
1019
    type Output = USizeVec4;
1020
    #[inline]
1021
    fn mul(self, rhs: USizeVec4) -> USizeVec4 {
3✔
1022
        (*self).mul(rhs)
3✔
1023
    }
1024
}
1025

1026
impl MulAssign for USizeVec4 {
1027
    #[inline]
1028
    fn mul_assign(&mut self, rhs: Self) {
3✔
1029
        self.x.mul_assign(rhs.x);
3✔
1030
        self.y.mul_assign(rhs.y);
3✔
1031
        self.z.mul_assign(rhs.z);
3✔
1032
        self.w.mul_assign(rhs.w);
3✔
1033
    }
1034
}
1035

1036
impl MulAssign<&Self> for USizeVec4 {
1037
    #[inline]
1038
    fn mul_assign(&mut self, rhs: &Self) {
3✔
1039
        self.mul_assign(*rhs);
3✔
1040
    }
1041
}
1042

1043
impl Mul<usize> for USizeVec4 {
1044
    type Output = Self;
1045
    #[inline]
1046
    fn mul(self, rhs: usize) -> Self {
3✔
1047
        Self {
1048
            x: self.x.mul(rhs),
3✔
1049
            y: self.y.mul(rhs),
3✔
1050
            z: self.z.mul(rhs),
3✔
1051
            w: self.w.mul(rhs),
3✔
1052
        }
1053
    }
1054
}
1055

1056
impl Mul<&usize> for USizeVec4 {
1057
    type Output = Self;
1058
    #[inline]
1059
    fn mul(self, rhs: &usize) -> Self {
3✔
1060
        self.mul(*rhs)
3✔
1061
    }
1062
}
1063

1064
impl Mul<&usize> for &USizeVec4 {
1065
    type Output = USizeVec4;
1066
    #[inline]
1067
    fn mul(self, rhs: &usize) -> USizeVec4 {
3✔
1068
        (*self).mul(*rhs)
3✔
1069
    }
1070
}
1071

1072
impl Mul<usize> for &USizeVec4 {
1073
    type Output = USizeVec4;
1074
    #[inline]
1075
    fn mul(self, rhs: usize) -> USizeVec4 {
3✔
1076
        (*self).mul(rhs)
3✔
1077
    }
1078
}
1079

1080
impl MulAssign<usize> for USizeVec4 {
1081
    #[inline]
1082
    fn mul_assign(&mut self, rhs: usize) {
3✔
1083
        self.x.mul_assign(rhs);
3✔
1084
        self.y.mul_assign(rhs);
3✔
1085
        self.z.mul_assign(rhs);
3✔
1086
        self.w.mul_assign(rhs);
3✔
1087
    }
1088
}
1089

1090
impl MulAssign<&usize> for USizeVec4 {
1091
    #[inline]
1092
    fn mul_assign(&mut self, rhs: &usize) {
3✔
1093
        self.mul_assign(*rhs);
3✔
1094
    }
1095
}
1096

1097
impl Mul<USizeVec4> for usize {
1098
    type Output = USizeVec4;
1099
    #[inline]
1100
    fn mul(self, rhs: USizeVec4) -> USizeVec4 {
3✔
1101
        USizeVec4 {
1102
            x: self.mul(rhs.x),
3✔
1103
            y: self.mul(rhs.y),
3✔
1104
            z: self.mul(rhs.z),
3✔
1105
            w: self.mul(rhs.w),
3✔
1106
        }
1107
    }
1108
}
1109

1110
impl Mul<&USizeVec4> for usize {
1111
    type Output = USizeVec4;
1112
    #[inline]
1113
    fn mul(self, rhs: &USizeVec4) -> USizeVec4 {
3✔
1114
        self.mul(*rhs)
3✔
1115
    }
1116
}
1117

1118
impl Mul<&USizeVec4> for &usize {
1119
    type Output = USizeVec4;
1120
    #[inline]
1121
    fn mul(self, rhs: &USizeVec4) -> USizeVec4 {
3✔
1122
        (*self).mul(*rhs)
3✔
1123
    }
1124
}
1125

1126
impl Mul<USizeVec4> for &usize {
1127
    type Output = USizeVec4;
1128
    #[inline]
1129
    fn mul(self, rhs: USizeVec4) -> USizeVec4 {
3✔
1130
        (*self).mul(rhs)
3✔
1131
    }
1132
}
1133

1134
impl Add for USizeVec4 {
1135
    type Output = Self;
1136
    #[inline]
1137
    fn add(self, rhs: Self) -> Self {
3✔
1138
        Self {
1139
            x: self.x.add(rhs.x),
3✔
1140
            y: self.y.add(rhs.y),
3✔
1141
            z: self.z.add(rhs.z),
3✔
1142
            w: self.w.add(rhs.w),
3✔
1143
        }
1144
    }
1145
}
1146

1147
impl Add<&Self> for USizeVec4 {
1148
    type Output = Self;
1149
    #[inline]
1150
    fn add(self, rhs: &Self) -> Self {
3✔
1151
        self.add(*rhs)
3✔
1152
    }
1153
}
1154

1155
impl Add<&USizeVec4> for &USizeVec4 {
1156
    type Output = USizeVec4;
1157
    #[inline]
1158
    fn add(self, rhs: &USizeVec4) -> USizeVec4 {
3✔
1159
        (*self).add(*rhs)
3✔
1160
    }
1161
}
1162

1163
impl Add<USizeVec4> for &USizeVec4 {
1164
    type Output = USizeVec4;
1165
    #[inline]
1166
    fn add(self, rhs: USizeVec4) -> USizeVec4 {
3✔
1167
        (*self).add(rhs)
3✔
1168
    }
1169
}
1170

1171
impl AddAssign for USizeVec4 {
1172
    #[inline]
1173
    fn add_assign(&mut self, rhs: Self) {
3✔
1174
        self.x.add_assign(rhs.x);
3✔
1175
        self.y.add_assign(rhs.y);
3✔
1176
        self.z.add_assign(rhs.z);
3✔
1177
        self.w.add_assign(rhs.w);
3✔
1178
    }
1179
}
1180

1181
impl AddAssign<&Self> for USizeVec4 {
1182
    #[inline]
1183
    fn add_assign(&mut self, rhs: &Self) {
3✔
1184
        self.add_assign(*rhs);
3✔
1185
    }
1186
}
1187

1188
impl Add<usize> for USizeVec4 {
1189
    type Output = Self;
1190
    #[inline]
1191
    fn add(self, rhs: usize) -> Self {
3✔
1192
        Self {
1193
            x: self.x.add(rhs),
3✔
1194
            y: self.y.add(rhs),
3✔
1195
            z: self.z.add(rhs),
3✔
1196
            w: self.w.add(rhs),
3✔
1197
        }
1198
    }
1199
}
1200

1201
impl Add<&usize> for USizeVec4 {
1202
    type Output = Self;
1203
    #[inline]
1204
    fn add(self, rhs: &usize) -> Self {
3✔
1205
        self.add(*rhs)
3✔
1206
    }
1207
}
1208

1209
impl Add<&usize> for &USizeVec4 {
1210
    type Output = USizeVec4;
1211
    #[inline]
1212
    fn add(self, rhs: &usize) -> USizeVec4 {
3✔
1213
        (*self).add(*rhs)
3✔
1214
    }
1215
}
1216

1217
impl Add<usize> for &USizeVec4 {
1218
    type Output = USizeVec4;
1219
    #[inline]
1220
    fn add(self, rhs: usize) -> USizeVec4 {
3✔
1221
        (*self).add(rhs)
3✔
1222
    }
1223
}
1224

1225
impl AddAssign<usize> for USizeVec4 {
1226
    #[inline]
1227
    fn add_assign(&mut self, rhs: usize) {
3✔
1228
        self.x.add_assign(rhs);
3✔
1229
        self.y.add_assign(rhs);
3✔
1230
        self.z.add_assign(rhs);
3✔
1231
        self.w.add_assign(rhs);
3✔
1232
    }
1233
}
1234

1235
impl AddAssign<&usize> for USizeVec4 {
1236
    #[inline]
1237
    fn add_assign(&mut self, rhs: &usize) {
3✔
1238
        self.add_assign(*rhs);
3✔
1239
    }
1240
}
1241

1242
impl Add<USizeVec4> for usize {
1243
    type Output = USizeVec4;
1244
    #[inline]
1245
    fn add(self, rhs: USizeVec4) -> USizeVec4 {
3✔
1246
        USizeVec4 {
1247
            x: self.add(rhs.x),
3✔
1248
            y: self.add(rhs.y),
3✔
1249
            z: self.add(rhs.z),
3✔
1250
            w: self.add(rhs.w),
3✔
1251
        }
1252
    }
1253
}
1254

1255
impl Add<&USizeVec4> for usize {
1256
    type Output = USizeVec4;
1257
    #[inline]
1258
    fn add(self, rhs: &USizeVec4) -> USizeVec4 {
3✔
1259
        self.add(*rhs)
3✔
1260
    }
1261
}
1262

1263
impl Add<&USizeVec4> for &usize {
1264
    type Output = USizeVec4;
1265
    #[inline]
1266
    fn add(self, rhs: &USizeVec4) -> USizeVec4 {
3✔
1267
        (*self).add(*rhs)
3✔
1268
    }
1269
}
1270

1271
impl Add<USizeVec4> for &usize {
1272
    type Output = USizeVec4;
1273
    #[inline]
1274
    fn add(self, rhs: USizeVec4) -> USizeVec4 {
3✔
1275
        (*self).add(rhs)
3✔
1276
    }
1277
}
1278

1279
impl Sub for USizeVec4 {
1280
    type Output = Self;
1281
    #[inline]
1282
    fn sub(self, rhs: Self) -> Self {
3✔
1283
        Self {
1284
            x: self.x.sub(rhs.x),
3✔
1285
            y: self.y.sub(rhs.y),
3✔
1286
            z: self.z.sub(rhs.z),
3✔
1287
            w: self.w.sub(rhs.w),
3✔
1288
        }
1289
    }
1290
}
1291

1292
impl Sub<&Self> for USizeVec4 {
1293
    type Output = Self;
1294
    #[inline]
1295
    fn sub(self, rhs: &Self) -> Self {
3✔
1296
        self.sub(*rhs)
3✔
1297
    }
1298
}
1299

1300
impl Sub<&USizeVec4> for &USizeVec4 {
1301
    type Output = USizeVec4;
1302
    #[inline]
1303
    fn sub(self, rhs: &USizeVec4) -> USizeVec4 {
3✔
1304
        (*self).sub(*rhs)
3✔
1305
    }
1306
}
1307

1308
impl Sub<USizeVec4> for &USizeVec4 {
1309
    type Output = USizeVec4;
1310
    #[inline]
1311
    fn sub(self, rhs: USizeVec4) -> USizeVec4 {
3✔
1312
        (*self).sub(rhs)
3✔
1313
    }
1314
}
1315

1316
impl SubAssign for USizeVec4 {
1317
    #[inline]
1318
    fn sub_assign(&mut self, rhs: Self) {
3✔
1319
        self.x.sub_assign(rhs.x);
3✔
1320
        self.y.sub_assign(rhs.y);
3✔
1321
        self.z.sub_assign(rhs.z);
3✔
1322
        self.w.sub_assign(rhs.w);
3✔
1323
    }
1324
}
1325

1326
impl SubAssign<&Self> for USizeVec4 {
1327
    #[inline]
1328
    fn sub_assign(&mut self, rhs: &Self) {
3✔
1329
        self.sub_assign(*rhs);
3✔
1330
    }
1331
}
1332

1333
impl Sub<usize> for USizeVec4 {
1334
    type Output = Self;
1335
    #[inline]
1336
    fn sub(self, rhs: usize) -> Self {
3✔
1337
        Self {
1338
            x: self.x.sub(rhs),
3✔
1339
            y: self.y.sub(rhs),
3✔
1340
            z: self.z.sub(rhs),
3✔
1341
            w: self.w.sub(rhs),
3✔
1342
        }
1343
    }
1344
}
1345

1346
impl Sub<&usize> for USizeVec4 {
1347
    type Output = Self;
1348
    #[inline]
1349
    fn sub(self, rhs: &usize) -> Self {
3✔
1350
        self.sub(*rhs)
3✔
1351
    }
1352
}
1353

1354
impl Sub<&usize> for &USizeVec4 {
1355
    type Output = USizeVec4;
1356
    #[inline]
1357
    fn sub(self, rhs: &usize) -> USizeVec4 {
3✔
1358
        (*self).sub(*rhs)
3✔
1359
    }
1360
}
1361

1362
impl Sub<usize> for &USizeVec4 {
1363
    type Output = USizeVec4;
1364
    #[inline]
1365
    fn sub(self, rhs: usize) -> USizeVec4 {
3✔
1366
        (*self).sub(rhs)
3✔
1367
    }
1368
}
1369

1370
impl SubAssign<usize> for USizeVec4 {
1371
    #[inline]
1372
    fn sub_assign(&mut self, rhs: usize) {
3✔
1373
        self.x.sub_assign(rhs);
3✔
1374
        self.y.sub_assign(rhs);
3✔
1375
        self.z.sub_assign(rhs);
3✔
1376
        self.w.sub_assign(rhs);
3✔
1377
    }
1378
}
1379

1380
impl SubAssign<&usize> for USizeVec4 {
1381
    #[inline]
1382
    fn sub_assign(&mut self, rhs: &usize) {
3✔
1383
        self.sub_assign(*rhs);
3✔
1384
    }
1385
}
1386

1387
impl Sub<USizeVec4> for usize {
1388
    type Output = USizeVec4;
1389
    #[inline]
1390
    fn sub(self, rhs: USizeVec4) -> USizeVec4 {
3✔
1391
        USizeVec4 {
1392
            x: self.sub(rhs.x),
3✔
1393
            y: self.sub(rhs.y),
3✔
1394
            z: self.sub(rhs.z),
3✔
1395
            w: self.sub(rhs.w),
3✔
1396
        }
1397
    }
1398
}
1399

1400
impl Sub<&USizeVec4> for usize {
1401
    type Output = USizeVec4;
1402
    #[inline]
1403
    fn sub(self, rhs: &USizeVec4) -> USizeVec4 {
3✔
1404
        self.sub(*rhs)
3✔
1405
    }
1406
}
1407

1408
impl Sub<&USizeVec4> for &usize {
1409
    type Output = USizeVec4;
1410
    #[inline]
1411
    fn sub(self, rhs: &USizeVec4) -> USizeVec4 {
3✔
1412
        (*self).sub(*rhs)
3✔
1413
    }
1414
}
1415

1416
impl Sub<USizeVec4> for &usize {
1417
    type Output = USizeVec4;
1418
    #[inline]
1419
    fn sub(self, rhs: USizeVec4) -> USizeVec4 {
3✔
1420
        (*self).sub(rhs)
3✔
1421
    }
1422
}
1423

1424
impl Rem for USizeVec4 {
1425
    type Output = Self;
1426
    #[inline]
1427
    fn rem(self, rhs: Self) -> Self {
3✔
1428
        Self {
1429
            x: self.x.rem(rhs.x),
3✔
1430
            y: self.y.rem(rhs.y),
3✔
1431
            z: self.z.rem(rhs.z),
3✔
1432
            w: self.w.rem(rhs.w),
3✔
1433
        }
1434
    }
1435
}
1436

1437
impl Rem<&Self> for USizeVec4 {
1438
    type Output = Self;
1439
    #[inline]
1440
    fn rem(self, rhs: &Self) -> Self {
3✔
1441
        self.rem(*rhs)
3✔
1442
    }
1443
}
1444

1445
impl Rem<&USizeVec4> for &USizeVec4 {
1446
    type Output = USizeVec4;
1447
    #[inline]
1448
    fn rem(self, rhs: &USizeVec4) -> USizeVec4 {
3✔
1449
        (*self).rem(*rhs)
3✔
1450
    }
1451
}
1452

1453
impl Rem<USizeVec4> for &USizeVec4 {
1454
    type Output = USizeVec4;
1455
    #[inline]
1456
    fn rem(self, rhs: USizeVec4) -> USizeVec4 {
3✔
1457
        (*self).rem(rhs)
3✔
1458
    }
1459
}
1460

1461
impl RemAssign for USizeVec4 {
1462
    #[inline]
1463
    fn rem_assign(&mut self, rhs: Self) {
3✔
1464
        self.x.rem_assign(rhs.x);
3✔
1465
        self.y.rem_assign(rhs.y);
3✔
1466
        self.z.rem_assign(rhs.z);
3✔
1467
        self.w.rem_assign(rhs.w);
4✔
1468
    }
1469
}
1470

1471
impl RemAssign<&Self> for USizeVec4 {
1472
    #[inline]
1473
    fn rem_assign(&mut self, rhs: &Self) {
3✔
1474
        self.rem_assign(*rhs);
3✔
1475
    }
1476
}
1477

1478
impl Rem<usize> for USizeVec4 {
1479
    type Output = Self;
1480
    #[inline]
1481
    fn rem(self, rhs: usize) -> Self {
3✔
1482
        Self {
1483
            x: self.x.rem(rhs),
3✔
1484
            y: self.y.rem(rhs),
3✔
1485
            z: self.z.rem(rhs),
3✔
1486
            w: self.w.rem(rhs),
3✔
1487
        }
1488
    }
1489
}
1490

1491
impl Rem<&usize> for USizeVec4 {
1492
    type Output = Self;
1493
    #[inline]
1494
    fn rem(self, rhs: &usize) -> Self {
3✔
1495
        self.rem(*rhs)
3✔
1496
    }
1497
}
1498

1499
impl Rem<&usize> for &USizeVec4 {
1500
    type Output = USizeVec4;
1501
    #[inline]
1502
    fn rem(self, rhs: &usize) -> USizeVec4 {
3✔
1503
        (*self).rem(*rhs)
3✔
1504
    }
1505
}
1506

1507
impl Rem<usize> for &USizeVec4 {
1508
    type Output = USizeVec4;
1509
    #[inline]
1510
    fn rem(self, rhs: usize) -> USizeVec4 {
3✔
1511
        (*self).rem(rhs)
3✔
1512
    }
1513
}
1514

1515
impl RemAssign<usize> for USizeVec4 {
1516
    #[inline]
1517
    fn rem_assign(&mut self, rhs: usize) {
3✔
1518
        self.x.rem_assign(rhs);
3✔
1519
        self.y.rem_assign(rhs);
3✔
1520
        self.z.rem_assign(rhs);
3✔
1521
        self.w.rem_assign(rhs);
3✔
1522
    }
1523
}
1524

1525
impl RemAssign<&usize> for USizeVec4 {
1526
    #[inline]
1527
    fn rem_assign(&mut self, rhs: &usize) {
3✔
1528
        self.rem_assign(*rhs);
3✔
1529
    }
1530
}
1531

1532
impl Rem<USizeVec4> for usize {
1533
    type Output = USizeVec4;
1534
    #[inline]
1535
    fn rem(self, rhs: USizeVec4) -> USizeVec4 {
3✔
1536
        USizeVec4 {
1537
            x: self.rem(rhs.x),
3✔
1538
            y: self.rem(rhs.y),
3✔
1539
            z: self.rem(rhs.z),
3✔
1540
            w: self.rem(rhs.w),
3✔
1541
        }
1542
    }
1543
}
1544

1545
impl Rem<&USizeVec4> for usize {
1546
    type Output = USizeVec4;
1547
    #[inline]
1548
    fn rem(self, rhs: &USizeVec4) -> USizeVec4 {
3✔
1549
        self.rem(*rhs)
3✔
1550
    }
1551
}
1552

1553
impl Rem<&USizeVec4> for &usize {
1554
    type Output = USizeVec4;
1555
    #[inline]
1556
    fn rem(self, rhs: &USizeVec4) -> USizeVec4 {
3✔
1557
        (*self).rem(*rhs)
3✔
1558
    }
1559
}
1560

1561
impl Rem<USizeVec4> for &usize {
1562
    type Output = USizeVec4;
1563
    #[inline]
1564
    fn rem(self, rhs: USizeVec4) -> USizeVec4 {
3✔
1565
        (*self).rem(rhs)
3✔
1566
    }
1567
}
1568

1569
impl AsRef<[usize; 4]> for USizeVec4 {
1570
    #[inline]
1571
    fn as_ref(&self) -> &[usize; 4] {
3✔
1572
        unsafe { &*(self as *const Self as *const [usize; 4]) }
3✔
1573
    }
1574
}
1575

1576
impl AsMut<[usize; 4]> for USizeVec4 {
1577
    #[inline]
1578
    fn as_mut(&mut self) -> &mut [usize; 4] {
3✔
1579
        unsafe { &mut *(self as *mut Self as *mut [usize; 4]) }
3✔
1580
    }
1581
}
1582

1583
impl Sum for USizeVec4 {
1584
    #[inline]
1585
    fn sum<I>(iter: I) -> Self
3✔
1586
    where
1587
        I: Iterator<Item = Self>,
1588
    {
1589
        iter.fold(Self::ZERO, Self::add)
3✔
1590
    }
1591
}
1592

1593
impl<'a> Sum<&'a Self> for USizeVec4 {
1594
    #[inline]
1595
    fn sum<I>(iter: I) -> Self
3✔
1596
    where
1597
        I: Iterator<Item = &'a Self>,
1598
    {
1599
        iter.fold(Self::ZERO, |a, &b| Self::add(a, b))
9✔
1600
    }
1601
}
1602

1603
impl Product for USizeVec4 {
1604
    #[inline]
1605
    fn product<I>(iter: I) -> Self
3✔
1606
    where
1607
        I: Iterator<Item = Self>,
1608
    {
1609
        iter.fold(Self::ONE, Self::mul)
3✔
1610
    }
1611
}
1612

1613
impl<'a> Product<&'a Self> for USizeVec4 {
1614
    #[inline]
1615
    fn product<I>(iter: I) -> Self
3✔
1616
    where
1617
        I: Iterator<Item = &'a Self>,
1618
    {
1619
        iter.fold(Self::ONE, |a, &b| Self::mul(a, b))
9✔
1620
    }
1621
}
1622

1623
impl Not for USizeVec4 {
1624
    type Output = Self;
1625
    #[inline]
1626
    fn not(self) -> Self {
3✔
1627
        Self {
1628
            x: self.x.not(),
3✔
1629
            y: self.y.not(),
3✔
1630
            z: self.z.not(),
3✔
1631
            w: self.w.not(),
3✔
1632
        }
1633
    }
1634
}
1635

1636
impl Not for &USizeVec4 {
1637
    type Output = USizeVec4;
1638
    #[inline]
1639
    fn not(self) -> USizeVec4 {
3✔
1640
        (*self).not()
3✔
1641
    }
1642
}
1643

1644
impl BitAnd for USizeVec4 {
1645
    type Output = Self;
1646
    #[inline]
1647
    fn bitand(self, rhs: Self) -> Self::Output {
3✔
1648
        Self {
1649
            x: self.x.bitand(rhs.x),
3✔
1650
            y: self.y.bitand(rhs.y),
3✔
1651
            z: self.z.bitand(rhs.z),
3✔
1652
            w: self.w.bitand(rhs.w),
3✔
1653
        }
1654
    }
1655
}
1656

1657
impl BitAnd<&Self> for USizeVec4 {
1658
    type Output = Self;
1659
    #[inline]
1660
    fn bitand(self, rhs: &Self) -> Self {
3✔
1661
        self.bitand(*rhs)
3✔
1662
    }
1663
}
1664

1665
impl BitAnd<&USizeVec4> for &USizeVec4 {
1666
    type Output = USizeVec4;
1667
    #[inline]
1668
    fn bitand(self, rhs: &USizeVec4) -> USizeVec4 {
3✔
1669
        (*self).bitand(*rhs)
3✔
1670
    }
1671
}
1672

1673
impl BitAnd<USizeVec4> for &USizeVec4 {
1674
    type Output = USizeVec4;
1675
    #[inline]
1676
    fn bitand(self, rhs: USizeVec4) -> USizeVec4 {
3✔
1677
        (*self).bitand(rhs)
3✔
1678
    }
1679
}
1680

1681
impl BitAndAssign for USizeVec4 {
1682
    #[inline]
1683
    fn bitand_assign(&mut self, rhs: Self) {
3✔
1684
        *self = self.bitand(rhs);
3✔
1685
    }
1686
}
1687

1688
impl BitAndAssign<&Self> for USizeVec4 {
1689
    #[inline]
1690
    fn bitand_assign(&mut self, rhs: &Self) {
3✔
1691
        self.bitand_assign(*rhs);
3✔
1692
    }
1693
}
1694

1695
impl BitOr for USizeVec4 {
1696
    type Output = Self;
1697
    #[inline]
1698
    fn bitor(self, rhs: Self) -> Self::Output {
3✔
1699
        Self {
1700
            x: self.x.bitor(rhs.x),
3✔
1701
            y: self.y.bitor(rhs.y),
3✔
1702
            z: self.z.bitor(rhs.z),
3✔
1703
            w: self.w.bitor(rhs.w),
3✔
1704
        }
1705
    }
1706
}
1707

1708
impl BitOr<&Self> for USizeVec4 {
1709
    type Output = Self;
1710
    #[inline]
1711
    fn bitor(self, rhs: &Self) -> Self {
3✔
1712
        self.bitor(*rhs)
3✔
1713
    }
1714
}
1715

1716
impl BitOr<&USizeVec4> for &USizeVec4 {
1717
    type Output = USizeVec4;
1718
    #[inline]
1719
    fn bitor(self, rhs: &USizeVec4) -> USizeVec4 {
3✔
1720
        (*self).bitor(*rhs)
3✔
1721
    }
1722
}
1723

1724
impl BitOr<USizeVec4> for &USizeVec4 {
1725
    type Output = USizeVec4;
1726
    #[inline]
1727
    fn bitor(self, rhs: USizeVec4) -> USizeVec4 {
3✔
1728
        (*self).bitor(rhs)
3✔
1729
    }
1730
}
1731

1732
impl BitOrAssign for USizeVec4 {
1733
    #[inline]
1734
    fn bitor_assign(&mut self, rhs: Self) {
3✔
1735
        *self = self.bitor(rhs);
3✔
1736
    }
1737
}
1738

1739
impl BitOrAssign<&Self> for USizeVec4 {
1740
    #[inline]
1741
    fn bitor_assign(&mut self, rhs: &Self) {
3✔
1742
        self.bitor_assign(*rhs);
3✔
1743
    }
1744
}
1745

1746
impl BitXor for USizeVec4 {
1747
    type Output = Self;
1748
    #[inline]
1749
    fn bitxor(self, rhs: Self) -> Self::Output {
3✔
1750
        Self {
1751
            x: self.x.bitxor(rhs.x),
3✔
1752
            y: self.y.bitxor(rhs.y),
3✔
1753
            z: self.z.bitxor(rhs.z),
3✔
1754
            w: self.w.bitxor(rhs.w),
3✔
1755
        }
1756
    }
1757
}
1758

1759
impl BitXor<&Self> for USizeVec4 {
1760
    type Output = Self;
1761
    #[inline]
1762
    fn bitxor(self, rhs: &Self) -> Self {
3✔
1763
        self.bitxor(*rhs)
3✔
1764
    }
1765
}
1766

1767
impl BitXor<&USizeVec4> for &USizeVec4 {
1768
    type Output = USizeVec4;
1769
    #[inline]
1770
    fn bitxor(self, rhs: &USizeVec4) -> USizeVec4 {
3✔
1771
        (*self).bitxor(*rhs)
3✔
1772
    }
1773
}
1774

1775
impl BitXor<USizeVec4> for &USizeVec4 {
1776
    type Output = USizeVec4;
1777
    #[inline]
1778
    fn bitxor(self, rhs: USizeVec4) -> USizeVec4 {
3✔
1779
        (*self).bitxor(rhs)
3✔
1780
    }
1781
}
1782

1783
impl BitXorAssign for USizeVec4 {
1784
    #[inline]
1785
    fn bitxor_assign(&mut self, rhs: Self) {
3✔
1786
        *self = self.bitxor(rhs);
3✔
1787
    }
1788
}
1789

1790
impl BitXorAssign<&Self> for USizeVec4 {
1791
    #[inline]
1792
    fn bitxor_assign(&mut self, rhs: &Self) {
3✔
1793
        self.bitxor_assign(*rhs);
3✔
1794
    }
1795
}
1796

1797
impl BitAnd<usize> for USizeVec4 {
1798
    type Output = Self;
1799
    #[inline]
1800
    fn bitand(self, rhs: usize) -> Self::Output {
3✔
1801
        Self {
1802
            x: self.x.bitand(rhs),
3✔
1803
            y: self.y.bitand(rhs),
3✔
1804
            z: self.z.bitand(rhs),
3✔
1805
            w: self.w.bitand(rhs),
3✔
1806
        }
1807
    }
1808
}
1809

1810
impl BitAnd<&usize> for USizeVec4 {
1811
    type Output = Self;
1812
    #[inline]
1813
    fn bitand(self, rhs: &usize) -> Self {
3✔
1814
        self.bitand(*rhs)
3✔
1815
    }
1816
}
1817

1818
impl BitAnd<&usize> for &USizeVec4 {
1819
    type Output = USizeVec4;
1820
    #[inline]
1821
    fn bitand(self, rhs: &usize) -> USizeVec4 {
3✔
1822
        (*self).bitand(*rhs)
3✔
1823
    }
1824
}
1825

1826
impl BitAnd<usize> for &USizeVec4 {
1827
    type Output = USizeVec4;
1828
    #[inline]
1829
    fn bitand(self, rhs: usize) -> USizeVec4 {
3✔
1830
        (*self).bitand(rhs)
3✔
1831
    }
1832
}
1833

1834
impl BitAndAssign<usize> for USizeVec4 {
1835
    #[inline]
1836
    fn bitand_assign(&mut self, rhs: usize) {
3✔
1837
        *self = self.bitand(rhs);
3✔
1838
    }
1839
}
1840

1841
impl BitAndAssign<&usize> for USizeVec4 {
1842
    #[inline]
1843
    fn bitand_assign(&mut self, rhs: &usize) {
3✔
1844
        self.bitand_assign(*rhs);
3✔
1845
    }
1846
}
1847

1848
impl BitOr<usize> for USizeVec4 {
1849
    type Output = Self;
1850
    #[inline]
1851
    fn bitor(self, rhs: usize) -> Self::Output {
3✔
1852
        Self {
1853
            x: self.x.bitor(rhs),
3✔
1854
            y: self.y.bitor(rhs),
3✔
1855
            z: self.z.bitor(rhs),
3✔
1856
            w: self.w.bitor(rhs),
3✔
1857
        }
1858
    }
1859
}
1860

1861
impl BitOr<&usize> for USizeVec4 {
1862
    type Output = Self;
1863
    #[inline]
1864
    fn bitor(self, rhs: &usize) -> Self {
3✔
1865
        self.bitor(*rhs)
3✔
1866
    }
1867
}
1868

1869
impl BitOr<&usize> for &USizeVec4 {
1870
    type Output = USizeVec4;
1871
    #[inline]
1872
    fn bitor(self, rhs: &usize) -> USizeVec4 {
3✔
1873
        (*self).bitor(*rhs)
3✔
1874
    }
1875
}
1876

1877
impl BitOr<usize> for &USizeVec4 {
1878
    type Output = USizeVec4;
1879
    #[inline]
1880
    fn bitor(self, rhs: usize) -> USizeVec4 {
3✔
1881
        (*self).bitor(rhs)
3✔
1882
    }
1883
}
1884

1885
impl BitOrAssign<usize> for USizeVec4 {
1886
    #[inline]
1887
    fn bitor_assign(&mut self, rhs: usize) {
3✔
1888
        *self = self.bitor(rhs);
3✔
1889
    }
1890
}
1891

1892
impl BitOrAssign<&usize> for USizeVec4 {
1893
    #[inline]
1894
    fn bitor_assign(&mut self, rhs: &usize) {
3✔
1895
        self.bitor_assign(*rhs);
3✔
1896
    }
1897
}
1898

1899
impl BitXor<usize> for USizeVec4 {
1900
    type Output = Self;
1901
    #[inline]
1902
    fn bitxor(self, rhs: usize) -> Self::Output {
3✔
1903
        Self {
1904
            x: self.x.bitxor(rhs),
3✔
1905
            y: self.y.bitxor(rhs),
3✔
1906
            z: self.z.bitxor(rhs),
3✔
1907
            w: self.w.bitxor(rhs),
3✔
1908
        }
1909
    }
1910
}
1911

1912
impl BitXor<&usize> for USizeVec4 {
1913
    type Output = Self;
1914
    #[inline]
1915
    fn bitxor(self, rhs: &usize) -> Self {
3✔
1916
        self.bitxor(*rhs)
3✔
1917
    }
1918
}
1919

1920
impl BitXor<&usize> for &USizeVec4 {
1921
    type Output = USizeVec4;
1922
    #[inline]
1923
    fn bitxor(self, rhs: &usize) -> USizeVec4 {
3✔
1924
        (*self).bitxor(*rhs)
3✔
1925
    }
1926
}
1927

1928
impl BitXor<usize> for &USizeVec4 {
1929
    type Output = USizeVec4;
1930
    #[inline]
1931
    fn bitxor(self, rhs: usize) -> USizeVec4 {
3✔
1932
        (*self).bitxor(rhs)
3✔
1933
    }
1934
}
1935

1936
impl BitXorAssign<usize> for USizeVec4 {
1937
    #[inline]
1938
    fn bitxor_assign(&mut self, rhs: usize) {
3✔
1939
        *self = self.bitxor(rhs);
3✔
1940
    }
1941
}
1942

1943
impl BitXorAssign<&usize> for USizeVec4 {
1944
    #[inline]
1945
    fn bitxor_assign(&mut self, rhs: &usize) {
3✔
1946
        self.bitxor_assign(*rhs);
3✔
1947
    }
1948
}
1949

1950
impl Shl<i8> for USizeVec4 {
1951
    type Output = Self;
1952
    #[inline]
1953
    fn shl(self, rhs: i8) -> Self::Output {
3✔
1954
        Self {
1955
            x: self.x.shl(rhs),
3✔
1956
            y: self.y.shl(rhs),
3✔
1957
            z: self.z.shl(rhs),
3✔
1958
            w: self.w.shl(rhs),
3✔
1959
        }
1960
    }
1961
}
1962

1963
impl Shl<&i8> for USizeVec4 {
1964
    type Output = Self;
1965
    #[inline]
1966
    fn shl(self, rhs: &i8) -> Self {
3✔
1967
        self.shl(*rhs)
3✔
1968
    }
1969
}
1970

1971
impl Shl<&i8> for &USizeVec4 {
1972
    type Output = USizeVec4;
1973
    #[inline]
1974
    fn shl(self, rhs: &i8) -> USizeVec4 {
3✔
1975
        (*self).shl(*rhs)
3✔
1976
    }
1977
}
1978

1979
impl Shl<i8> for &USizeVec4 {
1980
    type Output = USizeVec4;
1981
    #[inline]
1982
    fn shl(self, rhs: i8) -> USizeVec4 {
3✔
1983
        (*self).shl(rhs)
3✔
1984
    }
1985
}
1986

1987
impl ShlAssign<i8> for USizeVec4 {
1988
    #[inline]
1989
    fn shl_assign(&mut self, rhs: i8) {
3✔
1990
        *self = self.shl(rhs);
3✔
1991
    }
1992
}
1993

1994
impl ShlAssign<&i8> for USizeVec4 {
1995
    #[inline]
1996
    fn shl_assign(&mut self, rhs: &i8) {
3✔
1997
        self.shl_assign(*rhs);
3✔
1998
    }
1999
}
2000

2001
impl Shr<i8> for USizeVec4 {
2002
    type Output = Self;
2003
    #[inline]
2004
    fn shr(self, rhs: i8) -> Self::Output {
3✔
2005
        Self {
2006
            x: self.x.shr(rhs),
3✔
2007
            y: self.y.shr(rhs),
3✔
2008
            z: self.z.shr(rhs),
3✔
2009
            w: self.w.shr(rhs),
3✔
2010
        }
2011
    }
2012
}
2013

2014
impl Shr<&i8> for USizeVec4 {
2015
    type Output = Self;
2016
    #[inline]
2017
    fn shr(self, rhs: &i8) -> Self {
3✔
2018
        self.shr(*rhs)
3✔
2019
    }
2020
}
2021

2022
impl Shr<&i8> for &USizeVec4 {
2023
    type Output = USizeVec4;
2024
    #[inline]
2025
    fn shr(self, rhs: &i8) -> USizeVec4 {
3✔
2026
        (*self).shr(*rhs)
3✔
2027
    }
2028
}
2029

2030
impl Shr<i8> for &USizeVec4 {
2031
    type Output = USizeVec4;
2032
    #[inline]
2033
    fn shr(self, rhs: i8) -> USizeVec4 {
3✔
2034
        (*self).shr(rhs)
3✔
2035
    }
2036
}
2037

2038
impl ShrAssign<i8> for USizeVec4 {
2039
    #[inline]
2040
    fn shr_assign(&mut self, rhs: i8) {
3✔
2041
        *self = self.shr(rhs);
3✔
2042
    }
2043
}
2044

2045
impl ShrAssign<&i8> for USizeVec4 {
2046
    #[inline]
2047
    fn shr_assign(&mut self, rhs: &i8) {
3✔
2048
        self.shr_assign(*rhs);
3✔
2049
    }
2050
}
2051

2052
impl Shl<i16> for USizeVec4 {
2053
    type Output = Self;
2054
    #[inline]
2055
    fn shl(self, rhs: i16) -> Self::Output {
3✔
2056
        Self {
2057
            x: self.x.shl(rhs),
3✔
2058
            y: self.y.shl(rhs),
3✔
2059
            z: self.z.shl(rhs),
3✔
2060
            w: self.w.shl(rhs),
3✔
2061
        }
2062
    }
2063
}
2064

2065
impl Shl<&i16> for USizeVec4 {
2066
    type Output = Self;
2067
    #[inline]
2068
    fn shl(self, rhs: &i16) -> Self {
3✔
2069
        self.shl(*rhs)
3✔
2070
    }
2071
}
2072

2073
impl Shl<&i16> for &USizeVec4 {
2074
    type Output = USizeVec4;
2075
    #[inline]
2076
    fn shl(self, rhs: &i16) -> USizeVec4 {
3✔
2077
        (*self).shl(*rhs)
3✔
2078
    }
2079
}
2080

2081
impl Shl<i16> for &USizeVec4 {
2082
    type Output = USizeVec4;
2083
    #[inline]
2084
    fn shl(self, rhs: i16) -> USizeVec4 {
3✔
2085
        (*self).shl(rhs)
3✔
2086
    }
2087
}
2088

2089
impl ShlAssign<i16> for USizeVec4 {
2090
    #[inline]
2091
    fn shl_assign(&mut self, rhs: i16) {
3✔
2092
        *self = self.shl(rhs);
3✔
2093
    }
2094
}
2095

2096
impl ShlAssign<&i16> for USizeVec4 {
2097
    #[inline]
2098
    fn shl_assign(&mut self, rhs: &i16) {
3✔
2099
        self.shl_assign(*rhs);
3✔
2100
    }
2101
}
2102

2103
impl Shr<i16> for USizeVec4 {
2104
    type Output = Self;
2105
    #[inline]
2106
    fn shr(self, rhs: i16) -> Self::Output {
3✔
2107
        Self {
2108
            x: self.x.shr(rhs),
3✔
2109
            y: self.y.shr(rhs),
3✔
2110
            z: self.z.shr(rhs),
3✔
2111
            w: self.w.shr(rhs),
3✔
2112
        }
2113
    }
2114
}
2115

2116
impl Shr<&i16> for USizeVec4 {
2117
    type Output = Self;
2118
    #[inline]
2119
    fn shr(self, rhs: &i16) -> Self {
3✔
2120
        self.shr(*rhs)
3✔
2121
    }
2122
}
2123

2124
impl Shr<&i16> for &USizeVec4 {
2125
    type Output = USizeVec4;
2126
    #[inline]
2127
    fn shr(self, rhs: &i16) -> USizeVec4 {
3✔
2128
        (*self).shr(*rhs)
3✔
2129
    }
2130
}
2131

2132
impl Shr<i16> for &USizeVec4 {
2133
    type Output = USizeVec4;
2134
    #[inline]
2135
    fn shr(self, rhs: i16) -> USizeVec4 {
3✔
2136
        (*self).shr(rhs)
3✔
2137
    }
2138
}
2139

2140
impl ShrAssign<i16> for USizeVec4 {
2141
    #[inline]
2142
    fn shr_assign(&mut self, rhs: i16) {
3✔
2143
        *self = self.shr(rhs);
3✔
2144
    }
2145
}
2146

2147
impl ShrAssign<&i16> for USizeVec4 {
2148
    #[inline]
2149
    fn shr_assign(&mut self, rhs: &i16) {
3✔
2150
        self.shr_assign(*rhs);
3✔
2151
    }
2152
}
2153

2154
impl Shl<i32> for USizeVec4 {
2155
    type Output = Self;
2156
    #[inline]
2157
    fn shl(self, rhs: i32) -> Self::Output {
3✔
2158
        Self {
2159
            x: self.x.shl(rhs),
3✔
2160
            y: self.y.shl(rhs),
3✔
2161
            z: self.z.shl(rhs),
3✔
2162
            w: self.w.shl(rhs),
3✔
2163
        }
2164
    }
2165
}
2166

2167
impl Shl<&i32> for USizeVec4 {
2168
    type Output = Self;
2169
    #[inline]
2170
    fn shl(self, rhs: &i32) -> Self {
3✔
2171
        self.shl(*rhs)
3✔
2172
    }
2173
}
2174

2175
impl Shl<&i32> for &USizeVec4 {
2176
    type Output = USizeVec4;
2177
    #[inline]
2178
    fn shl(self, rhs: &i32) -> USizeVec4 {
3✔
2179
        (*self).shl(*rhs)
3✔
2180
    }
2181
}
2182

2183
impl Shl<i32> for &USizeVec4 {
2184
    type Output = USizeVec4;
2185
    #[inline]
2186
    fn shl(self, rhs: i32) -> USizeVec4 {
3✔
2187
        (*self).shl(rhs)
3✔
2188
    }
2189
}
2190

2191
impl ShlAssign<i32> for USizeVec4 {
2192
    #[inline]
2193
    fn shl_assign(&mut self, rhs: i32) {
3✔
2194
        *self = self.shl(rhs);
3✔
2195
    }
2196
}
2197

2198
impl ShlAssign<&i32> for USizeVec4 {
2199
    #[inline]
2200
    fn shl_assign(&mut self, rhs: &i32) {
3✔
2201
        self.shl_assign(*rhs);
3✔
2202
    }
2203
}
2204

2205
impl Shr<i32> for USizeVec4 {
2206
    type Output = Self;
2207
    #[inline]
2208
    fn shr(self, rhs: i32) -> Self::Output {
3✔
2209
        Self {
2210
            x: self.x.shr(rhs),
3✔
2211
            y: self.y.shr(rhs),
3✔
2212
            z: self.z.shr(rhs),
3✔
2213
            w: self.w.shr(rhs),
3✔
2214
        }
2215
    }
2216
}
2217

2218
impl Shr<&i32> for USizeVec4 {
2219
    type Output = Self;
2220
    #[inline]
2221
    fn shr(self, rhs: &i32) -> Self {
3✔
2222
        self.shr(*rhs)
3✔
2223
    }
2224
}
2225

2226
impl Shr<&i32> for &USizeVec4 {
2227
    type Output = USizeVec4;
2228
    #[inline]
2229
    fn shr(self, rhs: &i32) -> USizeVec4 {
3✔
2230
        (*self).shr(*rhs)
3✔
2231
    }
2232
}
2233

2234
impl Shr<i32> for &USizeVec4 {
2235
    type Output = USizeVec4;
2236
    #[inline]
2237
    fn shr(self, rhs: i32) -> USizeVec4 {
3✔
2238
        (*self).shr(rhs)
3✔
2239
    }
2240
}
2241

2242
impl ShrAssign<i32> for USizeVec4 {
2243
    #[inline]
2244
    fn shr_assign(&mut self, rhs: i32) {
3✔
2245
        *self = self.shr(rhs);
3✔
2246
    }
2247
}
2248

2249
impl ShrAssign<&i32> for USizeVec4 {
2250
    #[inline]
2251
    fn shr_assign(&mut self, rhs: &i32) {
3✔
2252
        self.shr_assign(*rhs);
3✔
2253
    }
2254
}
2255

2256
impl Shl<i64> for USizeVec4 {
2257
    type Output = Self;
2258
    #[inline]
2259
    fn shl(self, rhs: i64) -> Self::Output {
3✔
2260
        Self {
2261
            x: self.x.shl(rhs),
3✔
2262
            y: self.y.shl(rhs),
3✔
2263
            z: self.z.shl(rhs),
3✔
2264
            w: self.w.shl(rhs),
3✔
2265
        }
2266
    }
2267
}
2268

2269
impl Shl<&i64> for USizeVec4 {
2270
    type Output = Self;
2271
    #[inline]
2272
    fn shl(self, rhs: &i64) -> Self {
3✔
2273
        self.shl(*rhs)
3✔
2274
    }
2275
}
2276

2277
impl Shl<&i64> for &USizeVec4 {
2278
    type Output = USizeVec4;
2279
    #[inline]
2280
    fn shl(self, rhs: &i64) -> USizeVec4 {
3✔
2281
        (*self).shl(*rhs)
3✔
2282
    }
2283
}
2284

2285
impl Shl<i64> for &USizeVec4 {
2286
    type Output = USizeVec4;
2287
    #[inline]
2288
    fn shl(self, rhs: i64) -> USizeVec4 {
3✔
2289
        (*self).shl(rhs)
3✔
2290
    }
2291
}
2292

2293
impl ShlAssign<i64> for USizeVec4 {
2294
    #[inline]
2295
    fn shl_assign(&mut self, rhs: i64) {
3✔
2296
        *self = self.shl(rhs);
3✔
2297
    }
2298
}
2299

2300
impl ShlAssign<&i64> for USizeVec4 {
2301
    #[inline]
2302
    fn shl_assign(&mut self, rhs: &i64) {
3✔
2303
        self.shl_assign(*rhs);
3✔
2304
    }
2305
}
2306

2307
impl Shr<i64> for USizeVec4 {
2308
    type Output = Self;
2309
    #[inline]
2310
    fn shr(self, rhs: i64) -> Self::Output {
3✔
2311
        Self {
2312
            x: self.x.shr(rhs),
3✔
2313
            y: self.y.shr(rhs),
3✔
2314
            z: self.z.shr(rhs),
3✔
2315
            w: self.w.shr(rhs),
3✔
2316
        }
2317
    }
2318
}
2319

2320
impl Shr<&i64> for USizeVec4 {
2321
    type Output = Self;
2322
    #[inline]
2323
    fn shr(self, rhs: &i64) -> Self {
3✔
2324
        self.shr(*rhs)
3✔
2325
    }
2326
}
2327

2328
impl Shr<&i64> for &USizeVec4 {
2329
    type Output = USizeVec4;
2330
    #[inline]
2331
    fn shr(self, rhs: &i64) -> USizeVec4 {
3✔
2332
        (*self).shr(*rhs)
3✔
2333
    }
2334
}
2335

2336
impl Shr<i64> for &USizeVec4 {
2337
    type Output = USizeVec4;
2338
    #[inline]
2339
    fn shr(self, rhs: i64) -> USizeVec4 {
3✔
2340
        (*self).shr(rhs)
3✔
2341
    }
2342
}
2343

2344
impl ShrAssign<i64> for USizeVec4 {
2345
    #[inline]
2346
    fn shr_assign(&mut self, rhs: i64) {
3✔
2347
        *self = self.shr(rhs);
3✔
2348
    }
2349
}
2350

2351
impl ShrAssign<&i64> for USizeVec4 {
2352
    #[inline]
2353
    fn shr_assign(&mut self, rhs: &i64) {
3✔
2354
        self.shr_assign(*rhs);
3✔
2355
    }
2356
}
2357

2358
impl Shl<u8> for USizeVec4 {
2359
    type Output = Self;
2360
    #[inline]
2361
    fn shl(self, rhs: u8) -> Self::Output {
3✔
2362
        Self {
2363
            x: self.x.shl(rhs),
3✔
2364
            y: self.y.shl(rhs),
3✔
2365
            z: self.z.shl(rhs),
3✔
2366
            w: self.w.shl(rhs),
3✔
2367
        }
2368
    }
2369
}
2370

2371
impl Shl<&u8> for USizeVec4 {
2372
    type Output = Self;
2373
    #[inline]
2374
    fn shl(self, rhs: &u8) -> Self {
3✔
2375
        self.shl(*rhs)
3✔
2376
    }
2377
}
2378

2379
impl Shl<&u8> for &USizeVec4 {
2380
    type Output = USizeVec4;
2381
    #[inline]
2382
    fn shl(self, rhs: &u8) -> USizeVec4 {
3✔
2383
        (*self).shl(*rhs)
3✔
2384
    }
2385
}
2386

2387
impl Shl<u8> for &USizeVec4 {
2388
    type Output = USizeVec4;
2389
    #[inline]
2390
    fn shl(self, rhs: u8) -> USizeVec4 {
3✔
2391
        (*self).shl(rhs)
3✔
2392
    }
2393
}
2394

2395
impl ShlAssign<u8> for USizeVec4 {
2396
    #[inline]
2397
    fn shl_assign(&mut self, rhs: u8) {
3✔
2398
        *self = self.shl(rhs);
3✔
2399
    }
2400
}
2401

2402
impl ShlAssign<&u8> for USizeVec4 {
2403
    #[inline]
2404
    fn shl_assign(&mut self, rhs: &u8) {
3✔
2405
        self.shl_assign(*rhs);
3✔
2406
    }
2407
}
2408

2409
impl Shr<u8> for USizeVec4 {
2410
    type Output = Self;
2411
    #[inline]
2412
    fn shr(self, rhs: u8) -> Self::Output {
3✔
2413
        Self {
2414
            x: self.x.shr(rhs),
3✔
2415
            y: self.y.shr(rhs),
3✔
2416
            z: self.z.shr(rhs),
3✔
2417
            w: self.w.shr(rhs),
3✔
2418
        }
2419
    }
2420
}
2421

2422
impl Shr<&u8> for USizeVec4 {
2423
    type Output = Self;
2424
    #[inline]
2425
    fn shr(self, rhs: &u8) -> Self {
3✔
2426
        self.shr(*rhs)
3✔
2427
    }
2428
}
2429

2430
impl Shr<&u8> for &USizeVec4 {
2431
    type Output = USizeVec4;
2432
    #[inline]
2433
    fn shr(self, rhs: &u8) -> USizeVec4 {
3✔
2434
        (*self).shr(*rhs)
3✔
2435
    }
2436
}
2437

2438
impl Shr<u8> for &USizeVec4 {
2439
    type Output = USizeVec4;
2440
    #[inline]
2441
    fn shr(self, rhs: u8) -> USizeVec4 {
3✔
2442
        (*self).shr(rhs)
3✔
2443
    }
2444
}
2445

2446
impl ShrAssign<u8> for USizeVec4 {
2447
    #[inline]
2448
    fn shr_assign(&mut self, rhs: u8) {
3✔
2449
        *self = self.shr(rhs);
3✔
2450
    }
2451
}
2452

2453
impl ShrAssign<&u8> for USizeVec4 {
2454
    #[inline]
2455
    fn shr_assign(&mut self, rhs: &u8) {
3✔
2456
        self.shr_assign(*rhs);
3✔
2457
    }
2458
}
2459

2460
impl Shl<u16> for USizeVec4 {
2461
    type Output = Self;
2462
    #[inline]
2463
    fn shl(self, rhs: u16) -> Self::Output {
3✔
2464
        Self {
2465
            x: self.x.shl(rhs),
3✔
2466
            y: self.y.shl(rhs),
3✔
2467
            z: self.z.shl(rhs),
3✔
2468
            w: self.w.shl(rhs),
3✔
2469
        }
2470
    }
2471
}
2472

2473
impl Shl<&u16> for USizeVec4 {
2474
    type Output = Self;
2475
    #[inline]
2476
    fn shl(self, rhs: &u16) -> Self {
3✔
2477
        self.shl(*rhs)
3✔
2478
    }
2479
}
2480

2481
impl Shl<&u16> for &USizeVec4 {
2482
    type Output = USizeVec4;
2483
    #[inline]
2484
    fn shl(self, rhs: &u16) -> USizeVec4 {
3✔
2485
        (*self).shl(*rhs)
3✔
2486
    }
2487
}
2488

2489
impl Shl<u16> for &USizeVec4 {
2490
    type Output = USizeVec4;
2491
    #[inline]
2492
    fn shl(self, rhs: u16) -> USizeVec4 {
3✔
2493
        (*self).shl(rhs)
3✔
2494
    }
2495
}
2496

2497
impl ShlAssign<u16> for USizeVec4 {
2498
    #[inline]
2499
    fn shl_assign(&mut self, rhs: u16) {
3✔
2500
        *self = self.shl(rhs);
3✔
2501
    }
2502
}
2503

2504
impl ShlAssign<&u16> for USizeVec4 {
2505
    #[inline]
2506
    fn shl_assign(&mut self, rhs: &u16) {
3✔
2507
        self.shl_assign(*rhs);
3✔
2508
    }
2509
}
2510

2511
impl Shr<u16> for USizeVec4 {
2512
    type Output = Self;
2513
    #[inline]
2514
    fn shr(self, rhs: u16) -> Self::Output {
3✔
2515
        Self {
2516
            x: self.x.shr(rhs),
3✔
2517
            y: self.y.shr(rhs),
3✔
2518
            z: self.z.shr(rhs),
3✔
2519
            w: self.w.shr(rhs),
3✔
2520
        }
2521
    }
2522
}
2523

2524
impl Shr<&u16> for USizeVec4 {
2525
    type Output = Self;
2526
    #[inline]
2527
    fn shr(self, rhs: &u16) -> Self {
3✔
2528
        self.shr(*rhs)
3✔
2529
    }
2530
}
2531

2532
impl Shr<&u16> for &USizeVec4 {
2533
    type Output = USizeVec4;
2534
    #[inline]
2535
    fn shr(self, rhs: &u16) -> USizeVec4 {
3✔
2536
        (*self).shr(*rhs)
3✔
2537
    }
2538
}
2539

2540
impl Shr<u16> for &USizeVec4 {
2541
    type Output = USizeVec4;
2542
    #[inline]
2543
    fn shr(self, rhs: u16) -> USizeVec4 {
3✔
2544
        (*self).shr(rhs)
3✔
2545
    }
2546
}
2547

2548
impl ShrAssign<u16> for USizeVec4 {
2549
    #[inline]
2550
    fn shr_assign(&mut self, rhs: u16) {
3✔
2551
        *self = self.shr(rhs);
3✔
2552
    }
2553
}
2554

2555
impl ShrAssign<&u16> for USizeVec4 {
2556
    #[inline]
2557
    fn shr_assign(&mut self, rhs: &u16) {
3✔
2558
        self.shr_assign(*rhs);
3✔
2559
    }
2560
}
2561

2562
impl Shl<u32> for USizeVec4 {
2563
    type Output = Self;
2564
    #[inline]
2565
    fn shl(self, rhs: u32) -> Self::Output {
3✔
2566
        Self {
2567
            x: self.x.shl(rhs),
3✔
2568
            y: self.y.shl(rhs),
3✔
2569
            z: self.z.shl(rhs),
3✔
2570
            w: self.w.shl(rhs),
3✔
2571
        }
2572
    }
2573
}
2574

2575
impl Shl<&u32> for USizeVec4 {
2576
    type Output = Self;
2577
    #[inline]
2578
    fn shl(self, rhs: &u32) -> Self {
3✔
2579
        self.shl(*rhs)
3✔
2580
    }
2581
}
2582

2583
impl Shl<&u32> for &USizeVec4 {
2584
    type Output = USizeVec4;
2585
    #[inline]
2586
    fn shl(self, rhs: &u32) -> USizeVec4 {
3✔
2587
        (*self).shl(*rhs)
3✔
2588
    }
2589
}
2590

2591
impl Shl<u32> for &USizeVec4 {
2592
    type Output = USizeVec4;
2593
    #[inline]
2594
    fn shl(self, rhs: u32) -> USizeVec4 {
3✔
2595
        (*self).shl(rhs)
3✔
2596
    }
2597
}
2598

2599
impl ShlAssign<u32> for USizeVec4 {
2600
    #[inline]
2601
    fn shl_assign(&mut self, rhs: u32) {
3✔
2602
        *self = self.shl(rhs);
3✔
2603
    }
2604
}
2605

2606
impl ShlAssign<&u32> for USizeVec4 {
2607
    #[inline]
2608
    fn shl_assign(&mut self, rhs: &u32) {
3✔
2609
        self.shl_assign(*rhs);
3✔
2610
    }
2611
}
2612

2613
impl Shr<u32> for USizeVec4 {
2614
    type Output = Self;
2615
    #[inline]
2616
    fn shr(self, rhs: u32) -> Self::Output {
3✔
2617
        Self {
2618
            x: self.x.shr(rhs),
3✔
2619
            y: self.y.shr(rhs),
3✔
2620
            z: self.z.shr(rhs),
3✔
2621
            w: self.w.shr(rhs),
3✔
2622
        }
2623
    }
2624
}
2625

2626
impl Shr<&u32> for USizeVec4 {
2627
    type Output = Self;
2628
    #[inline]
2629
    fn shr(self, rhs: &u32) -> Self {
3✔
2630
        self.shr(*rhs)
3✔
2631
    }
2632
}
2633

2634
impl Shr<&u32> for &USizeVec4 {
2635
    type Output = USizeVec4;
2636
    #[inline]
2637
    fn shr(self, rhs: &u32) -> USizeVec4 {
3✔
2638
        (*self).shr(*rhs)
3✔
2639
    }
2640
}
2641

2642
impl Shr<u32> for &USizeVec4 {
2643
    type Output = USizeVec4;
2644
    #[inline]
2645
    fn shr(self, rhs: u32) -> USizeVec4 {
3✔
2646
        (*self).shr(rhs)
3✔
2647
    }
2648
}
2649

2650
impl ShrAssign<u32> for USizeVec4 {
2651
    #[inline]
2652
    fn shr_assign(&mut self, rhs: u32) {
3✔
2653
        *self = self.shr(rhs);
3✔
2654
    }
2655
}
2656

2657
impl ShrAssign<&u32> for USizeVec4 {
2658
    #[inline]
2659
    fn shr_assign(&mut self, rhs: &u32) {
3✔
2660
        self.shr_assign(*rhs);
3✔
2661
    }
2662
}
2663

2664
impl Shl<u64> for USizeVec4 {
2665
    type Output = Self;
2666
    #[inline]
2667
    fn shl(self, rhs: u64) -> Self::Output {
3✔
2668
        Self {
2669
            x: self.x.shl(rhs),
3✔
2670
            y: self.y.shl(rhs),
3✔
2671
            z: self.z.shl(rhs),
3✔
2672
            w: self.w.shl(rhs),
3✔
2673
        }
2674
    }
2675
}
2676

2677
impl Shl<&u64> for USizeVec4 {
2678
    type Output = Self;
2679
    #[inline]
2680
    fn shl(self, rhs: &u64) -> Self {
3✔
2681
        self.shl(*rhs)
3✔
2682
    }
2683
}
2684

2685
impl Shl<&u64> for &USizeVec4 {
2686
    type Output = USizeVec4;
2687
    #[inline]
2688
    fn shl(self, rhs: &u64) -> USizeVec4 {
3✔
2689
        (*self).shl(*rhs)
3✔
2690
    }
2691
}
2692

2693
impl Shl<u64> for &USizeVec4 {
2694
    type Output = USizeVec4;
2695
    #[inline]
2696
    fn shl(self, rhs: u64) -> USizeVec4 {
3✔
2697
        (*self).shl(rhs)
3✔
2698
    }
2699
}
2700

2701
impl ShlAssign<u64> for USizeVec4 {
2702
    #[inline]
2703
    fn shl_assign(&mut self, rhs: u64) {
3✔
2704
        *self = self.shl(rhs);
3✔
2705
    }
2706
}
2707

2708
impl ShlAssign<&u64> for USizeVec4 {
2709
    #[inline]
2710
    fn shl_assign(&mut self, rhs: &u64) {
3✔
2711
        self.shl_assign(*rhs);
3✔
2712
    }
2713
}
2714

2715
impl Shr<u64> for USizeVec4 {
2716
    type Output = Self;
2717
    #[inline]
2718
    fn shr(self, rhs: u64) -> Self::Output {
3✔
2719
        Self {
2720
            x: self.x.shr(rhs),
3✔
2721
            y: self.y.shr(rhs),
3✔
2722
            z: self.z.shr(rhs),
3✔
2723
            w: self.w.shr(rhs),
3✔
2724
        }
2725
    }
2726
}
2727

2728
impl Shr<&u64> for USizeVec4 {
2729
    type Output = Self;
2730
    #[inline]
2731
    fn shr(self, rhs: &u64) -> Self {
3✔
2732
        self.shr(*rhs)
3✔
2733
    }
2734
}
2735

2736
impl Shr<&u64> for &USizeVec4 {
2737
    type Output = USizeVec4;
2738
    #[inline]
2739
    fn shr(self, rhs: &u64) -> USizeVec4 {
3✔
2740
        (*self).shr(*rhs)
3✔
2741
    }
2742
}
2743

2744
impl Shr<u64> for &USizeVec4 {
2745
    type Output = USizeVec4;
2746
    #[inline]
2747
    fn shr(self, rhs: u64) -> USizeVec4 {
3✔
2748
        (*self).shr(rhs)
3✔
2749
    }
2750
}
2751

2752
impl ShrAssign<u64> for USizeVec4 {
2753
    #[inline]
2754
    fn shr_assign(&mut self, rhs: u64) {
3✔
2755
        *self = self.shr(rhs);
3✔
2756
    }
2757
}
2758

2759
impl ShrAssign<&u64> for USizeVec4 {
2760
    #[inline]
2761
    fn shr_assign(&mut self, rhs: &u64) {
3✔
2762
        self.shr_assign(*rhs);
3✔
2763
    }
2764
}
2765

2766
impl Shl<IVec4> for USizeVec4 {
2767
    type Output = Self;
2768
    #[inline]
2769
    fn shl(self, rhs: IVec4) -> Self {
3✔
2770
        Self {
2771
            x: self.x.shl(rhs.x),
3✔
2772
            y: self.y.shl(rhs.y),
3✔
2773
            z: self.z.shl(rhs.z),
3✔
2774
            w: self.w.shl(rhs.w),
3✔
2775
        }
2776
    }
2777
}
2778

2779
impl Shl<&IVec4> for USizeVec4 {
2780
    type Output = Self;
2781
    #[inline]
2782
    fn shl(self, rhs: &IVec4) -> Self {
3✔
2783
        self.shl(*rhs)
3✔
2784
    }
2785
}
2786

2787
impl Shl<&IVec4> for &USizeVec4 {
2788
    type Output = USizeVec4;
2789
    #[inline]
2790
    fn shl(self, rhs: &IVec4) -> USizeVec4 {
3✔
2791
        (*self).shl(*rhs)
3✔
2792
    }
2793
}
2794

2795
impl Shl<IVec4> for &USizeVec4 {
2796
    type Output = USizeVec4;
2797
    #[inline]
2798
    fn shl(self, rhs: IVec4) -> USizeVec4 {
3✔
2799
        (*self).shl(rhs)
3✔
2800
    }
2801
}
2802

2803
impl Shr<IVec4> for USizeVec4 {
2804
    type Output = Self;
2805
    #[inline]
2806
    fn shr(self, rhs: IVec4) -> Self {
3✔
2807
        Self {
2808
            x: self.x.shr(rhs.x),
3✔
2809
            y: self.y.shr(rhs.y),
3✔
2810
            z: self.z.shr(rhs.z),
3✔
2811
            w: self.w.shr(rhs.w),
3✔
2812
        }
2813
    }
2814
}
2815

2816
impl Shr<&IVec4> for USizeVec4 {
2817
    type Output = Self;
2818
    #[inline]
2819
    fn shr(self, rhs: &IVec4) -> Self {
3✔
2820
        self.shr(*rhs)
3✔
2821
    }
2822
}
2823

2824
impl Shr<&IVec4> for &USizeVec4 {
2825
    type Output = USizeVec4;
2826
    #[inline]
2827
    fn shr(self, rhs: &IVec4) -> USizeVec4 {
3✔
2828
        (*self).shr(*rhs)
3✔
2829
    }
2830
}
2831

2832
impl Shr<IVec4> for &USizeVec4 {
2833
    type Output = USizeVec4;
2834
    #[inline]
2835
    fn shr(self, rhs: IVec4) -> USizeVec4 {
3✔
2836
        (*self).shr(rhs)
3✔
2837
    }
2838
}
2839

2840
impl Shl<UVec4> for USizeVec4 {
2841
    type Output = Self;
2842
    #[inline]
2843
    fn shl(self, rhs: UVec4) -> Self {
3✔
2844
        Self {
2845
            x: self.x.shl(rhs.x),
3✔
2846
            y: self.y.shl(rhs.y),
3✔
2847
            z: self.z.shl(rhs.z),
3✔
2848
            w: self.w.shl(rhs.w),
3✔
2849
        }
2850
    }
2851
}
2852

2853
impl Shl<&UVec4> for USizeVec4 {
2854
    type Output = Self;
2855
    #[inline]
2856
    fn shl(self, rhs: &UVec4) -> Self {
3✔
2857
        self.shl(*rhs)
3✔
2858
    }
2859
}
2860

2861
impl Shl<&UVec4> for &USizeVec4 {
2862
    type Output = USizeVec4;
2863
    #[inline]
2864
    fn shl(self, rhs: &UVec4) -> USizeVec4 {
3✔
2865
        (*self).shl(*rhs)
3✔
2866
    }
2867
}
2868

2869
impl Shl<UVec4> for &USizeVec4 {
2870
    type Output = USizeVec4;
2871
    #[inline]
2872
    fn shl(self, rhs: UVec4) -> USizeVec4 {
3✔
2873
        (*self).shl(rhs)
3✔
2874
    }
2875
}
2876

2877
impl Shr<UVec4> for USizeVec4 {
2878
    type Output = Self;
2879
    #[inline]
2880
    fn shr(self, rhs: UVec4) -> Self {
3✔
2881
        Self {
2882
            x: self.x.shr(rhs.x),
3✔
2883
            y: self.y.shr(rhs.y),
3✔
2884
            z: self.z.shr(rhs.z),
3✔
2885
            w: self.w.shr(rhs.w),
3✔
2886
        }
2887
    }
2888
}
2889

2890
impl Shr<&UVec4> for USizeVec4 {
2891
    type Output = Self;
2892
    #[inline]
2893
    fn shr(self, rhs: &UVec4) -> Self {
3✔
2894
        self.shr(*rhs)
3✔
2895
    }
2896
}
2897

2898
impl Shr<&UVec4> for &USizeVec4 {
2899
    type Output = USizeVec4;
2900
    #[inline]
2901
    fn shr(self, rhs: &UVec4) -> USizeVec4 {
3✔
2902
        (*self).shr(*rhs)
3✔
2903
    }
2904
}
2905

2906
impl Shr<UVec4> for &USizeVec4 {
2907
    type Output = USizeVec4;
2908
    #[inline]
2909
    fn shr(self, rhs: UVec4) -> USizeVec4 {
3✔
2910
        (*self).shr(rhs)
3✔
2911
    }
2912
}
2913

2914
impl Index<usize> for USizeVec4 {
2915
    type Output = usize;
2916
    #[inline]
2917
    fn index(&self, index: usize) -> &Self::Output {
3✔
2918
        match index {
6✔
2919
            0 => &self.x,
3✔
2920
            1 => &self.y,
3✔
2921
            2 => &self.z,
3✔
2922
            3 => &self.w,
3✔
2923
            _ => panic!("index out of bounds"),
×
2924
        }
2925
    }
2926
}
2927

2928
impl IndexMut<usize> for USizeVec4 {
2929
    #[inline]
2930
    fn index_mut(&mut self, index: usize) -> &mut Self::Output {
3✔
2931
        match index {
6✔
2932
            0 => &mut self.x,
3✔
2933
            1 => &mut self.y,
3✔
2934
            2 => &mut self.z,
3✔
2935
            3 => &mut self.w,
3✔
2936
            _ => panic!("index out of bounds"),
×
2937
        }
2938
    }
2939
}
2940

2941
impl fmt::Display for USizeVec4 {
2942
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3✔
2943
        write!(f, "[{}, {}, {}, {}]", self.x, self.y, self.z, self.w)
3✔
2944
    }
2945
}
2946

2947
impl fmt::Debug for USizeVec4 {
2948
    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
3✔
2949
        fmt.debug_tuple(stringify!(USizeVec4))
3✔
2950
            .field(&self.x)
3✔
2951
            .field(&self.y)
3✔
2952
            .field(&self.z)
3✔
2953
            .field(&self.w)
3✔
2954
            .finish()
2955
    }
2956
}
2957

2958
impl From<[usize; 4]> for USizeVec4 {
2959
    #[inline]
2960
    fn from(a: [usize; 4]) -> Self {
3✔
2961
        Self::new(a[0], a[1], a[2], a[3])
3✔
2962
    }
2963
}
2964

2965
impl From<USizeVec4> for [usize; 4] {
2966
    #[inline]
2967
    fn from(v: USizeVec4) -> Self {
3✔
2968
        [v.x, v.y, v.z, v.w]
3✔
2969
    }
2970
}
2971

2972
impl From<(usize, usize, usize, usize)> for USizeVec4 {
2973
    #[inline]
2974
    fn from(t: (usize, usize, usize, usize)) -> Self {
3✔
2975
        Self::new(t.0, t.1, t.2, t.3)
3✔
2976
    }
2977
}
2978

2979
impl From<USizeVec4> for (usize, usize, usize, usize) {
2980
    #[inline]
2981
    fn from(v: USizeVec4) -> Self {
6✔
2982
        (v.x, v.y, v.z, v.w)
6✔
2983
    }
2984
}
2985

2986
impl From<(USizeVec3, usize)> for USizeVec4 {
2987
    #[inline]
2988
    fn from((v, w): (USizeVec3, usize)) -> Self {
6✔
2989
        Self::new(v.x, v.y, v.z, w)
3✔
2990
    }
2991
}
2992

2993
impl From<(usize, USizeVec3)> for USizeVec4 {
2994
    #[inline]
2995
    fn from((x, v): (usize, USizeVec3)) -> Self {
6✔
2996
        Self::new(x, v.x, v.y, v.z)
3✔
2997
    }
2998
}
2999

3000
impl From<(USizeVec2, usize, usize)> for USizeVec4 {
3001
    #[inline]
3002
    fn from((v, z, w): (USizeVec2, usize, usize)) -> Self {
6✔
3003
        Self::new(v.x, v.y, z, w)
×
3004
    }
3005
}
3006

3007
impl From<(USizeVec2, USizeVec2)> for USizeVec4 {
3008
    #[inline]
3009
    fn from((v, u): (USizeVec2, USizeVec2)) -> Self {
6✔
3010
        Self::new(v.x, v.y, u.x, u.y)
×
3011
    }
3012
}
3013

3014
impl From<U8Vec4> for USizeVec4 {
3015
    #[inline]
3016
    fn from(v: U8Vec4) -> Self {
3✔
3017
        Self::new(
3018
            usize::from(v.x),
3✔
3019
            usize::from(v.y),
3✔
3020
            usize::from(v.z),
3✔
3021
            usize::from(v.w),
3✔
3022
        )
3023
    }
3024
}
3025

3026
impl From<U16Vec4> for USizeVec4 {
3027
    #[inline]
3028
    fn from(v: U16Vec4) -> Self {
3✔
3029
        Self::new(
3030
            usize::from(v.x),
3✔
3031
            usize::from(v.y),
3✔
3032
            usize::from(v.z),
3✔
3033
            usize::from(v.w),
3✔
3034
        )
3035
    }
3036
}
3037

3038
impl TryFrom<I8Vec4> for USizeVec4 {
3039
    type Error = core::num::TryFromIntError;
3040

3041
    #[inline]
3042
    fn try_from(v: I8Vec4) -> Result<Self, Self::Error> {
3✔
3043
        Ok(Self::new(
3✔
3044
            usize::try_from(v.x)?,
3✔
3045
            usize::try_from(v.y)?,
3✔
3046
            usize::try_from(v.z)?,
3✔
3047
            usize::try_from(v.w)?,
3✔
3048
        ))
3049
    }
3050
}
3051

3052
impl TryFrom<I16Vec4> for USizeVec4 {
3053
    type Error = core::num::TryFromIntError;
3054

3055
    #[inline]
3056
    fn try_from(v: I16Vec4) -> Result<Self, Self::Error> {
3✔
3057
        Ok(Self::new(
3✔
3058
            usize::try_from(v.x)?,
3✔
3059
            usize::try_from(v.y)?,
3✔
3060
            usize::try_from(v.z)?,
3✔
3061
            usize::try_from(v.w)?,
3✔
3062
        ))
3063
    }
3064
}
3065

3066
impl TryFrom<IVec4> for USizeVec4 {
3067
    type Error = core::num::TryFromIntError;
3068

3069
    #[inline]
3070
    fn try_from(v: IVec4) -> Result<Self, Self::Error> {
3✔
3071
        Ok(Self::new(
3✔
3072
            usize::try_from(v.x)?,
3✔
3073
            usize::try_from(v.y)?,
3✔
3074
            usize::try_from(v.z)?,
3✔
3075
            usize::try_from(v.w)?,
3✔
3076
        ))
3077
    }
3078
}
3079

3080
impl TryFrom<I64Vec4> for USizeVec4 {
3081
    type Error = core::num::TryFromIntError;
3082

3083
    #[inline]
3084
    fn try_from(v: I64Vec4) -> Result<Self, Self::Error> {
3✔
3085
        Ok(Self::new(
3✔
3086
            usize::try_from(v.x)?,
3✔
3087
            usize::try_from(v.y)?,
3✔
3088
            usize::try_from(v.z)?,
3✔
3089
            usize::try_from(v.w)?,
3✔
3090
        ))
3091
    }
3092
}
3093

3094
impl TryFrom<UVec4> for USizeVec4 {
3095
    type Error = core::num::TryFromIntError;
3096

3097
    #[inline]
3098
    fn try_from(v: UVec4) -> Result<Self, Self::Error> {
3✔
3099
        Ok(Self::new(
3✔
3100
            usize::try_from(v.x)?,
3✔
3101
            usize::try_from(v.y)?,
3✔
3102
            usize::try_from(v.z)?,
3✔
3103
            usize::try_from(v.w)?,
3✔
3104
        ))
3105
    }
3106
}
3107

3108
impl TryFrom<U64Vec4> for USizeVec4 {
3109
    type Error = core::num::TryFromIntError;
3110

3111
    #[inline]
3112
    fn try_from(v: U64Vec4) -> Result<Self, Self::Error> {
3✔
3113
        Ok(Self::new(
3✔
3114
            usize::try_from(v.x)?,
3✔
3115
            usize::try_from(v.y)?,
3✔
3116
            usize::try_from(v.z)?,
3✔
3117
            usize::try_from(v.w)?,
3✔
3118
        ))
3119
    }
3120
}
3121

3122
impl TryFrom<ISizeVec4> for USizeVec4 {
3123
    type Error = core::num::TryFromIntError;
3124

3125
    #[inline]
3126
    fn try_from(v: ISizeVec4) -> Result<Self, Self::Error> {
3✔
3127
        Ok(Self::new(
3✔
3128
            usize::try_from(v.x)?,
3✔
3129
            usize::try_from(v.y)?,
3✔
3130
            usize::try_from(v.z)?,
3✔
3131
            usize::try_from(v.w)?,
3✔
3132
        ))
3133
    }
3134
}
3135

3136
impl From<BVec4> for USizeVec4 {
3137
    #[inline]
3138
    fn from(v: BVec4) -> Self {
3✔
3139
        Self::new(
3140
            usize::from(v.x),
3✔
3141
            usize::from(v.y),
3✔
3142
            usize::from(v.z),
3✔
3143
            usize::from(v.w),
3✔
3144
        )
3145
    }
3146
}
3147

3148
#[cfg(not(feature = "scalar-math"))]
3149
impl From<BVec4A> for USizeVec4 {
3150
    #[inline]
3151
    fn from(v: BVec4A) -> Self {
2✔
3152
        let bool_array: [bool; 4] = v.into();
2✔
3153
        Self::new(
3154
            usize::from(bool_array[0]),
2✔
3155
            usize::from(bool_array[1]),
2✔
3156
            usize::from(bool_array[2]),
2✔
3157
            usize::from(bool_array[3]),
2✔
3158
        )
3159
    }
3160
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc