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

bitshifter / glam-rs / 24918269367

25 Apr 2026 12:40AM UTC coverage: 97.134%. Remained the same
24918269367

push

github

bitshifter
Add types are conditional.

57276 of 58966 relevant lines covered (97.13%)

3.48 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::{BVec4, U16Vec4, U8Vec4, USizeVec2, USizeVec3};
6

7
#[cfg(feature = "i8")]
8
use crate::I8Vec4;
9

10
#[cfg(feature = "i16")]
11
use crate::I16Vec4;
12

13
#[cfg(feature = "i32")]
14
use crate::IVec4;
15

16
#[cfg(feature = "i64")]
17
use crate::I64Vec4;
18

19
#[cfg(feature = "u32")]
20
use crate::UVec4;
21

22
#[cfg(feature = "u64")]
23
use crate::U64Vec4;
24

25
#[cfg(feature = "isize")]
26
use crate::ISizeVec4;
27

28
use core::fmt;
29
use core::iter::{Product, Sum};
30
use core::{f32, ops::*};
31

32
#[cfg(feature = "zerocopy")]
33
use zerocopy_derive::*;
34

35
/// Creates a 4-dimensional vector.
36
#[inline(always)]
37
#[must_use]
38
pub const fn usizevec4(x: usize, y: usize, z: usize, w: usize) -> USizeVec4 {
6✔
39
    USizeVec4::new(x, y, z, w)
×
40
}
41

42
/// A 4-dimensional vector.
43
#[derive(Clone, Copy, PartialEq, Eq, Hash)]
44
#[cfg_attr(feature = "bytemuck", derive(bytemuck::Pod, bytemuck::Zeroable))]
45
#[cfg_attr(
46
    feature = "zerocopy",
47
    derive(FromBytes, Immutable, IntoBytes, KnownLayout)
48
)]
49
#[cfg_attr(feature = "cuda", repr(align(16)))]
50
#[repr(C)]
51
#[cfg_attr(target_arch = "spirv", rust_gpu::vector::v1)]
52
pub struct USizeVec4 {
53
    pub x: usize,
54
    pub y: usize,
55
    pub z: usize,
56
    pub w: usize,
57
}
58

59
impl USizeVec4 {
60
    /// All zeroes.
61
    pub const ZERO: Self = Self::splat(0);
62

63
    /// All ones.
64
    pub const ONE: Self = Self::splat(1);
65

66
    /// All `usize::MIN`.
67
    pub const MIN: Self = Self::splat(usize::MIN);
68

69
    /// All `usize::MAX`.
70
    pub const MAX: Self = Self::splat(usize::MAX);
71

72
    /// A unit vector pointing along the positive X axis.
73
    pub const X: Self = Self::new(1, 0, 0, 0);
74

75
    /// A unit vector pointing along the positive Y axis.
76
    pub const Y: Self = Self::new(0, 1, 0, 0);
77

78
    /// A unit vector pointing along the positive Z axis.
79
    pub const Z: Self = Self::new(0, 0, 1, 0);
80

81
    /// A unit vector pointing along the positive W axis.
82
    pub const W: Self = Self::new(0, 0, 0, 1);
83

84
    /// The unit axes.
85
    pub const AXES: [Self; 4] = [Self::X, Self::Y, Self::Z, Self::W];
86

87
    /// Creates a new vector.
88
    #[inline(always)]
89
    #[must_use]
90
    pub const fn new(x: usize, y: usize, z: usize, w: usize) -> Self {
12✔
91
        Self { x, y, z, w }
92
    }
93

94
    /// Creates a vector with all elements set to `v`.
95
    #[inline]
96
    #[must_use]
97
    pub const fn splat(v: usize) -> Self {
3✔
98
        Self {
99
            x: v,
100

101
            y: v,
102

103
            z: v,
104

105
            w: v,
106
        }
107
    }
108

109
    /// Returns a vector containing each element of `self` modified by a mapping function `f`.
110
    #[inline]
111
    #[must_use]
112
    pub fn map<F>(self, f: F) -> Self
6✔
113
    where
114
        F: Fn(usize) -> usize,
115
    {
116
        Self::new(f(self.x), f(self.y), f(self.z), f(self.w))
12✔
117
    }
118

119
    /// Creates a vector from the elements in `if_true` and `if_false`, selecting which to use
120
    /// for each element of `self`.
121
    ///
122
    /// A true element in the mask uses the corresponding element from `if_true`, and false
123
    /// uses the element from `if_false`.
124
    #[inline]
125
    #[must_use]
126
    pub fn select(mask: BVec4, if_true: Self, if_false: Self) -> Self {
3✔
127
        Self {
128
            x: if mask.test(0) { if_true.x } else { if_false.x },
3✔
129
            y: if mask.test(1) { if_true.y } else { if_false.y },
3✔
130
            z: if mask.test(2) { if_true.z } else { if_false.z },
3✔
131
            w: if mask.test(3) { if_true.w } else { if_false.w },
3✔
132
        }
133
    }
134

135
    /// Creates a new vector from an array.
136
    #[inline]
137
    #[must_use]
138
    pub const fn from_array(a: [usize; 4]) -> Self {
×
139
        Self::new(a[0], a[1], a[2], a[3])
×
140
    }
141

142
    /// Converts `self` to `[x, y, z, w]`
143
    #[inline]
144
    #[must_use]
145
    pub const fn to_array(&self) -> [usize; 4] {
3✔
146
        [self.x, self.y, self.z, self.w]
3✔
147
    }
148

149
    /// Creates a vector from the first 4 values in `slice`.
150
    ///
151
    /// # Panics
152
    ///
153
    /// Panics if `slice` is less than 4 elements long.
154
    #[inline]
155
    #[must_use]
156
    pub const fn from_slice(slice: &[usize]) -> Self {
3✔
157
        assert!(slice.len() >= 4);
3✔
158
        Self::new(slice[0], slice[1], slice[2], slice[3])
3✔
159
    }
160

161
    /// Writes the elements of `self` to the first 4 elements in `slice`.
162
    ///
163
    /// # Panics
164
    ///
165
    /// Panics if `slice` is less than 4 elements long.
166
    #[inline]
167
    pub fn write_to_slice(self, slice: &mut [usize]) {
3✔
168
        slice[..4].copy_from_slice(&self.to_array());
3✔
169
    }
170

171
    /// Creates a 3D vector from the `x`, `y` and `z` elements of `self`, discarding `w`.
172
    ///
173
    /// Truncation to [`USizeVec3`] may also be performed by using [`self.xyz()`][crate::swizzles::Vec4Swizzles::xyz()].
174
    #[inline]
175
    #[must_use]
176
    pub fn truncate(self) -> USizeVec3 {
6✔
177
        use crate::swizzles::Vec4Swizzles;
178
        self.xyz()
6✔
179
    }
180

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

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

197
    /// Creates a 4D vector from `self` with the given value of `z`.
198
    #[inline]
199
    #[must_use]
200
    pub fn with_z(mut self, z: usize) -> Self {
3✔
201
        self.z = z;
3✔
202
        self
3✔
203
    }
204

205
    /// Creates a 4D vector from `self` with the given value of `w`.
206
    #[inline]
207
    #[must_use]
208
    pub fn with_w(mut self, w: usize) -> Self {
3✔
209
        self.w = w;
3✔
210
        self
3✔
211
    }
212

213
    /// Computes the dot product of `self` and `rhs`.
214
    #[inline]
215
    #[must_use]
216
    pub fn dot(self, rhs: Self) -> usize {
3✔
217
        (self.x * rhs.x) + (self.y * rhs.y) + (self.z * rhs.z) + (self.w * rhs.w)
3✔
218
    }
219

220
    /// Returns a vector where every component is the dot product of `self` and `rhs`.
221
    #[inline]
222
    #[must_use]
223
    pub fn dot_into_vec(self, rhs: Self) -> Self {
3✔
224
        Self::splat(self.dot(rhs))
3✔
225
    }
226

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

241
    /// Returns a vector containing the maximum values for each element of `self` and `rhs`.
242
    ///
243
    /// In other words this computes `[max(self.x, rhs.x), max(self.y, rhs.y), ..]`.
244
    #[inline]
245
    #[must_use]
246
    pub fn max(self, rhs: Self) -> Self {
3✔
247
        Self {
248
            x: if self.x > rhs.x { self.x } else { rhs.x },
3✔
249
            y: if self.y > rhs.y { self.y } else { rhs.y },
3✔
250
            z: if self.z > rhs.z { self.z } else { rhs.z },
3✔
251
            w: if self.w > rhs.w { self.w } else { rhs.w },
3✔
252
        }
253
    }
254

255
    /// Component-wise clamping of values, similar to [`usize::clamp`].
256
    ///
257
    /// Each element in `min` must be less-or-equal to the corresponding element in `max`.
258
    ///
259
    /// # Panics
260
    ///
261
    /// Will panic if `min` is greater than `max` when `glam_assert` is enabled.
262
    #[inline]
263
    #[must_use]
264
    pub fn clamp(self, min: Self, max: Self) -> Self {
3✔
265
        glam_assert!(min.cmple(max).all(), "clamp: expected min <= max");
3✔
266
        self.max(min).min(max)
3✔
267
    }
268

269
    /// Returns the horizontal minimum of `self`.
270
    ///
271
    /// In other words this computes `min(x, y, ..)`.
272
    #[inline]
273
    #[must_use]
274
    pub fn min_element(self) -> usize {
3✔
275
        let min = |a, b| if a < b { a } else { b };
6✔
276
        min(self.x, min(self.y, min(self.z, self.w)))
3✔
277
    }
278

279
    /// Returns the horizontal maximum of `self`.
280
    ///
281
    /// In other words this computes `max(x, y, ..)`.
282
    #[inline]
283
    #[must_use]
284
    pub fn max_element(self) -> usize {
3✔
285
        let max = |a, b| if a > b { a } else { b };
6✔
286
        max(self.x, max(self.y, max(self.z, self.w)))
3✔
287
    }
288

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

310
    /// Returns the index of the first maximum element of `self`.
311
    #[doc(alias = "argmax")]
312
    #[inline]
313
    #[must_use]
314
    pub fn max_position(self) -> usize {
3✔
315
        let mut max = self.x;
3✔
316
        let mut index = 0;
3✔
317
        if self.y > max {
6✔
318
            max = self.y;
3✔
319
            index = 1;
3✔
320
        }
321
        if self.z > max {
6✔
322
            max = self.z;
3✔
323
            index = 2;
3✔
324
        }
325
        if self.w > max {
6✔
326
            index = 3;
3✔
327
        }
328
        index
3✔
329
    }
330

331
    /// Returns the sum of all elements of `self`.
332
    ///
333
    /// In other words, this computes `self.x + self.y + ..`.
334
    #[inline]
335
    #[must_use]
336
    pub fn element_sum(self) -> usize {
3✔
337
        self.x + self.y + self.z + self.w
3✔
338
    }
339

340
    /// Returns the product of all elements of `self`.
341
    ///
342
    /// In other words, this computes `self.x * self.y * ..`.
343
    #[inline]
344
    #[must_use]
345
    pub fn element_product(self) -> usize {
3✔
346
        self.x * self.y * self.z * self.w
3✔
347
    }
348

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

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

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

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

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

429
    /// Returns a vector mask containing the result of a `<` comparison for each element of
430
    /// `self` and `rhs`.
431
    ///
432
    /// In other words this computes `[self.x < rhs.x, self.y < rhs.y, ..]` for all
433
    /// elements.
434
    #[inline]
435
    #[must_use]
436
    pub fn cmplt(self, rhs: Self) -> BVec4 {
3✔
437
        BVec4::new(
438
            self.x.lt(&rhs.x),
3✔
439
            self.y.lt(&rhs.y),
3✔
440
            self.z.lt(&rhs.z),
3✔
441
            self.w.lt(&rhs.w),
3✔
442
        )
443
    }
444

445
    /// Computes the squared length of `self`.
446
    #[doc(alias = "magnitude2")]
447
    #[inline]
448
    #[must_use]
449
    pub fn length_squared(self) -> usize {
3✔
450
        self.dot(self)
3✔
451
    }
452

453
    /// Computes the [manhattan distance] between two points.
454
    ///
455
    /// # Overflow
456
    /// This method may overflow if the result is greater than [`usize::MAX`].
457
    ///
458
    /// See also [`checked_manhattan_distance`][USizeVec4::checked_manhattan_distance].
459
    ///
460
    /// [manhattan distance]: https://en.wikipedia.org/wiki/Taxicab_geometry
461
    #[inline]
462
    #[must_use]
463
    pub fn manhattan_distance(self, rhs: Self) -> usize {
3✔
464
        self.x.abs_diff(rhs.x)
12✔
465
            + self.y.abs_diff(rhs.y)
3✔
466
            + self.z.abs_diff(rhs.z)
3✔
467
            + self.w.abs_diff(rhs.w)
3✔
468
    }
469

470
    /// Computes the [manhattan distance] between two points.
471
    ///
472
    /// This will returns [`None`] if the result is greater than [`usize::MAX`].
473
    ///
474
    /// [manhattan distance]: https://en.wikipedia.org/wiki/Taxicab_geometry
475
    #[inline]
476
    #[must_use]
477
    pub fn checked_manhattan_distance(self, rhs: Self) -> Option<usize> {
3✔
478
        let d = self.x.abs_diff(rhs.x);
3✔
479
        let d = d.checked_add(self.y.abs_diff(rhs.y))?;
3✔
480
        let d = d.checked_add(self.z.abs_diff(rhs.z))?;
3✔
481
        d.checked_add(self.w.abs_diff(rhs.w))
3✔
482
    }
483

484
    /// Computes the [chebyshev distance] between two points.
485
    ///
486
    /// [chebyshev distance]: https://en.wikipedia.org/wiki/Chebyshev_distance
487
    #[inline]
488
    #[must_use]
489
    pub fn chebyshev_distance(self, rhs: Self) -> usize {
3✔
490
        // Note: the compiler will eventually optimize out the loop
491
        [
492
            self.x.abs_diff(rhs.x),
3✔
493
            self.y.abs_diff(rhs.y),
3✔
494
            self.z.abs_diff(rhs.z),
3✔
495
            self.w.abs_diff(rhs.w),
3✔
496
        ]
497
        .into_iter()
498
        .max()
499
        .unwrap()
500
    }
501

502
    /// Casts all elements of `self` to `f32`.
503
    #[inline]
504
    #[must_use]
505
    pub fn as_vec4(self) -> crate::Vec4 {
3✔
506
        crate::Vec4::new(self.x as f32, self.y as f32, self.z as f32, self.w as f32)
3✔
507
    }
508

509
    /// Casts all elements of `self` to `f64`.
510
    #[cfg(feature = "f64")]
511
    #[inline]
512
    #[must_use]
513
    pub fn as_dvec4(self) -> crate::DVec4 {
3✔
514
        crate::DVec4::new(self.x as f64, self.y as f64, self.z as f64, self.w as f64)
3✔
515
    }
516

517
    /// Casts all elements of `self` to `i8`.
518
    #[cfg(feature = "i8")]
519
    #[inline]
520
    #[must_use]
521
    pub fn as_i8vec4(self) -> crate::I8Vec4 {
3✔
522
        crate::I8Vec4::new(self.x as i8, self.y as i8, self.z as i8, self.w as i8)
3✔
523
    }
524

525
    /// Casts all elements of `self` to `u8`.
526
    #[cfg(feature = "u8")]
527
    #[inline]
528
    #[must_use]
529
    pub fn as_u8vec4(self) -> crate::U8Vec4 {
3✔
530
        crate::U8Vec4::new(self.x as u8, self.y as u8, self.z as u8, self.w as u8)
3✔
531
    }
532

533
    /// Casts all elements of `self` to `i16`.
534
    #[cfg(feature = "i16")]
535
    #[inline]
536
    #[must_use]
537
    pub fn as_i16vec4(self) -> crate::I16Vec4 {
3✔
538
        crate::I16Vec4::new(self.x as i16, self.y as i16, self.z as i16, self.w as i16)
3✔
539
    }
540

541
    /// Casts all elements of `self` to `u16`.
542
    #[cfg(feature = "u16")]
543
    #[inline]
544
    #[must_use]
545
    pub fn as_u16vec4(self) -> crate::U16Vec4 {
3✔
546
        crate::U16Vec4::new(self.x as u16, self.y as u16, self.z as u16, self.w as u16)
3✔
547
    }
548

549
    /// Casts all elements of `self` to `i32`.
550
    #[cfg(feature = "i32")]
551
    #[inline]
552
    #[must_use]
553
    pub fn as_ivec4(self) -> crate::IVec4 {
3✔
554
        crate::IVec4::new(self.x as i32, self.y as i32, self.z as i32, self.w as i32)
3✔
555
    }
556

557
    /// Casts all elements of `self` to `u32`.
558
    #[cfg(feature = "u32")]
559
    #[inline]
560
    #[must_use]
561
    pub fn as_uvec4(self) -> crate::UVec4 {
3✔
562
        crate::UVec4::new(self.x as u32, self.y as u32, self.z as u32, self.w as u32)
3✔
563
    }
564

565
    /// Casts all elements of `self` to `i64`.
566
    #[cfg(feature = "i64")]
567
    #[inline]
568
    #[must_use]
569
    pub fn as_i64vec4(self) -> crate::I64Vec4 {
3✔
570
        crate::I64Vec4::new(self.x as i64, self.y as i64, self.z as i64, self.w as i64)
3✔
571
    }
572

573
    /// Casts all elements of `self` to `u64`.
574
    #[cfg(feature = "u64")]
575
    #[inline]
576
    #[must_use]
577
    pub fn as_u64vec4(self) -> crate::U64Vec4 {
3✔
578
        crate::U64Vec4::new(self.x as u64, self.y as u64, self.z as u64, self.w as u64)
3✔
579
    }
580

581
    /// Casts all elements of `self` to `isize`.
582
    #[cfg(feature = "isize")]
583
    #[inline]
584
    #[must_use]
585
    pub fn as_isizevec4(self) -> crate::ISizeVec4 {
3✔
586
        crate::ISizeVec4::new(
587
            self.x as isize,
3✔
588
            self.y as isize,
3✔
589
            self.z as isize,
3✔
590
            self.w as isize,
3✔
591
        )
592
    }
593

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

617
        Some(Self { x, y, z, w })
3✔
618
    }
619

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

643
        Some(Self { x, y, z, w })
3✔
644
    }
645

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

669
        Some(Self { x, y, z, w })
3✔
670
    }
671

672
    /// Returns a vector containing the wrapping division of `self` and `rhs`.
673
    ///
674
    /// In other words this computes `Some([self.x / rhs.x, self.y / rhs.y, ..])` but returns `None` on any division by zero.
675
    #[inline]
676
    #[must_use]
677
    pub const fn checked_div(self, rhs: Self) -> Option<Self> {
3✔
678
        let x = match self.x.checked_div(rhs.x) {
3✔
679
            Some(v) => v,
3✔
680
            None => return None,
3✔
681
        };
682
        let y = match self.y.checked_div(rhs.y) {
3✔
683
            Some(v) => v,
3✔
684
            None => return None,
3✔
685
        };
686
        let z = match self.z.checked_div(rhs.z) {
3✔
687
            Some(v) => v,
3✔
688
            None => return None,
×
689
        };
690
        let w = match self.w.checked_div(rhs.w) {
3✔
691
            Some(v) => v,
3✔
692
            None => return None,
×
693
        };
694

695
        Some(Self { x, y, z, w })
3✔
696
    }
697

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

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

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

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

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

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

782
    /// Returns a vector containing the saturating multiplication of `self` and `rhs`.
783
    ///
784
    /// In other words this computes `[self.x.saturating_mul(rhs.x), self.y.saturating_mul(rhs.y), ..]`.
785
    #[inline]
786
    #[must_use]
787
    pub const fn saturating_mul(self, rhs: Self) -> Self {
3✔
788
        Self {
789
            x: self.x.saturating_mul(rhs.x),
3✔
790
            y: self.y.saturating_mul(rhs.y),
3✔
791
            z: self.z.saturating_mul(rhs.z),
3✔
792
            w: self.w.saturating_mul(rhs.w),
3✔
793
        }
794
    }
795

796
    /// Returns a vector containing the saturating division of `self` and `rhs`.
797
    ///
798
    /// In other words this computes `[self.x.saturating_div(rhs.x), self.y.saturating_div(rhs.y), ..]`.
799
    #[inline]
800
    #[must_use]
801
    pub const fn saturating_div(self, rhs: Self) -> Self {
3✔
802
        Self {
803
            x: self.x.saturating_div(rhs.x),
3✔
804
            y: self.y.saturating_div(rhs.y),
3✔
805
            z: self.z.saturating_div(rhs.z),
3✔
806
            w: self.w.saturating_div(rhs.w),
3✔
807
        }
808
    }
809

810
    /// Returns a vector containing the wrapping addition of `self` and signed vector `rhs`.
811
    ///
812
    /// In other words this computes `Some([self.x + rhs.x, self.y + rhs.y, ..])` but returns `None` on any overflow.
813

814
    #[cfg(feature = "isize")]
815
    #[inline]
816
    #[must_use]
817
    pub const fn checked_add_signed(self, rhs: ISizeVec4) -> Option<Self> {
3✔
818
        let x = match self.x.checked_add_signed(rhs.x) {
3✔
819
            Some(v) => v,
3✔
820
            None => return None,
3✔
821
        };
822
        let y = match self.y.checked_add_signed(rhs.y) {
3✔
823
            Some(v) => v,
3✔
824
            None => return None,
×
825
        };
826
        let z = match self.z.checked_add_signed(rhs.z) {
3✔
827
            Some(v) => v,
3✔
828
            None => return None,
×
829
        };
830
        let w = match self.w.checked_add_signed(rhs.w) {
3✔
831
            Some(v) => v,
3✔
832
            None => return None,
×
833
        };
834

835
        Some(Self { x, y, z, w })
3✔
836
    }
837

838
    /// Returns a vector containing the wrapping addition of `self` and signed vector `rhs`.
839
    ///
840
    /// In other words this computes `[self.x.wrapping_add_signed(rhs.x), self.y.wrapping_add_signed(rhs.y), ..]`.
841

842
    #[cfg(feature = "isize")]
843
    #[inline]
844
    #[must_use]
845
    pub const fn wrapping_add_signed(self, rhs: ISizeVec4) -> Self {
3✔
846
        Self {
847
            x: self.x.wrapping_add_signed(rhs.x),
3✔
848
            y: self.y.wrapping_add_signed(rhs.y),
3✔
849
            z: self.z.wrapping_add_signed(rhs.z),
3✔
850
            w: self.w.wrapping_add_signed(rhs.w),
3✔
851
        }
852
    }
853

854
    /// Returns a vector containing the saturating addition of `self` and signed vector `rhs`.
855
    ///
856
    /// In other words this computes `[self.x.saturating_add_signed(rhs.x), self.y.saturating_add_signed(rhs.y), ..]`.
857

858
    #[cfg(feature = "isize")]
859
    #[inline]
860
    #[must_use]
861
    pub const fn saturating_add_signed(self, rhs: ISizeVec4) -> Self {
3✔
862
        Self {
863
            x: self.x.saturating_add_signed(rhs.x),
3✔
864
            y: self.y.saturating_add_signed(rhs.y),
3✔
865
            z: self.z.saturating_add_signed(rhs.z),
3✔
866
            w: self.w.saturating_add_signed(rhs.w),
3✔
867
        }
868
    }
869
}
870

871
impl Default for USizeVec4 {
872
    #[inline(always)]
873
    fn default() -> Self {
3✔
874
        Self::ZERO
3✔
875
    }
876
}
877

878
impl Div for USizeVec4 {
879
    type Output = Self;
880
    #[inline]
881
    fn div(self, rhs: Self) -> Self {
3✔
882
        Self {
883
            x: self.x.div(rhs.x),
3✔
884
            y: self.y.div(rhs.y),
3✔
885
            z: self.z.div(rhs.z),
3✔
886
            w: self.w.div(rhs.w),
3✔
887
        }
888
    }
889
}
890

891
impl Div<&Self> for USizeVec4 {
892
    type Output = Self;
893
    #[inline]
894
    fn div(self, rhs: &Self) -> Self {
3✔
895
        self.div(*rhs)
3✔
896
    }
897
}
898

899
impl Div<&USizeVec4> for &USizeVec4 {
900
    type Output = USizeVec4;
901
    #[inline]
902
    fn div(self, rhs: &USizeVec4) -> USizeVec4 {
3✔
903
        (*self).div(*rhs)
3✔
904
    }
905
}
906

907
impl Div<USizeVec4> for &USizeVec4 {
908
    type Output = USizeVec4;
909
    #[inline]
910
    fn div(self, rhs: USizeVec4) -> USizeVec4 {
3✔
911
        (*self).div(rhs)
3✔
912
    }
913
}
914

915
impl DivAssign for USizeVec4 {
916
    #[inline]
917
    fn div_assign(&mut self, rhs: Self) {
3✔
918
        self.x.div_assign(rhs.x);
3✔
919
        self.y.div_assign(rhs.y);
5✔
920
        self.z.div_assign(rhs.z);
5✔
921
        self.w.div_assign(rhs.w);
5✔
922
    }
923
}
924

925
impl DivAssign<&Self> for USizeVec4 {
926
    #[inline]
927
    fn div_assign(&mut self, rhs: &Self) {
3✔
928
        self.div_assign(*rhs);
3✔
929
    }
930
}
931

932
impl Div<usize> for USizeVec4 {
933
    type Output = Self;
934
    #[inline]
935
    fn div(self, rhs: usize) -> Self {
3✔
936
        Self {
937
            x: self.x.div(rhs),
3✔
938
            y: self.y.div(rhs),
3✔
939
            z: self.z.div(rhs),
3✔
940
            w: self.w.div(rhs),
3✔
941
        }
942
    }
943
}
944

945
impl Div<&usize> for USizeVec4 {
946
    type Output = Self;
947
    #[inline]
948
    fn div(self, rhs: &usize) -> Self {
3✔
949
        self.div(*rhs)
3✔
950
    }
951
}
952

953
impl Div<&usize> for &USizeVec4 {
954
    type Output = USizeVec4;
955
    #[inline]
956
    fn div(self, rhs: &usize) -> USizeVec4 {
3✔
957
        (*self).div(*rhs)
3✔
958
    }
959
}
960

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

969
impl DivAssign<usize> for USizeVec4 {
970
    #[inline]
971
    fn div_assign(&mut self, rhs: usize) {
3✔
972
        self.x.div_assign(rhs);
3✔
973
        self.y.div_assign(rhs);
3✔
974
        self.z.div_assign(rhs);
3✔
975
        self.w.div_assign(rhs);
3✔
976
    }
977
}
978

979
impl DivAssign<&usize> for USizeVec4 {
980
    #[inline]
981
    fn div_assign(&mut self, rhs: &usize) {
3✔
982
        self.div_assign(*rhs);
3✔
983
    }
984
}
985

986
impl Div<USizeVec4> for usize {
987
    type Output = USizeVec4;
988
    #[inline]
989
    fn div(self, rhs: USizeVec4) -> USizeVec4 {
3✔
990
        USizeVec4 {
991
            x: self.div(rhs.x),
3✔
992
            y: self.div(rhs.y),
3✔
993
            z: self.div(rhs.z),
3✔
994
            w: self.div(rhs.w),
3✔
995
        }
996
    }
997
}
998

999
impl Div<&USizeVec4> for usize {
1000
    type Output = USizeVec4;
1001
    #[inline]
1002
    fn div(self, rhs: &USizeVec4) -> USizeVec4 {
3✔
1003
        self.div(*rhs)
3✔
1004
    }
1005
}
1006

1007
impl Div<&USizeVec4> for &usize {
1008
    type Output = USizeVec4;
1009
    #[inline]
1010
    fn div(self, rhs: &USizeVec4) -> USizeVec4 {
3✔
1011
        (*self).div(*rhs)
3✔
1012
    }
1013
}
1014

1015
impl Div<USizeVec4> for &usize {
1016
    type Output = USizeVec4;
1017
    #[inline]
1018
    fn div(self, rhs: USizeVec4) -> USizeVec4 {
3✔
1019
        (*self).div(rhs)
3✔
1020
    }
1021
}
1022

1023
impl Mul for USizeVec4 {
1024
    type Output = Self;
1025
    #[inline]
1026
    fn mul(self, rhs: Self) -> Self {
3✔
1027
        Self {
1028
            x: self.x.mul(rhs.x),
3✔
1029
            y: self.y.mul(rhs.y),
3✔
1030
            z: self.z.mul(rhs.z),
3✔
1031
            w: self.w.mul(rhs.w),
3✔
1032
        }
1033
    }
1034
}
1035

1036
impl Mul<&Self> for USizeVec4 {
1037
    type Output = Self;
1038
    #[inline]
1039
    fn mul(self, rhs: &Self) -> Self {
3✔
1040
        self.mul(*rhs)
3✔
1041
    }
1042
}
1043

1044
impl Mul<&USizeVec4> for &USizeVec4 {
1045
    type Output = USizeVec4;
1046
    #[inline]
1047
    fn mul(self, rhs: &USizeVec4) -> USizeVec4 {
3✔
1048
        (*self).mul(*rhs)
3✔
1049
    }
1050
}
1051

1052
impl Mul<USizeVec4> for &USizeVec4 {
1053
    type Output = USizeVec4;
1054
    #[inline]
1055
    fn mul(self, rhs: USizeVec4) -> USizeVec4 {
3✔
1056
        (*self).mul(rhs)
3✔
1057
    }
1058
}
1059

1060
impl MulAssign for USizeVec4 {
1061
    #[inline]
1062
    fn mul_assign(&mut self, rhs: Self) {
3✔
1063
        self.x.mul_assign(rhs.x);
3✔
1064
        self.y.mul_assign(rhs.y);
5✔
1065
        self.z.mul_assign(rhs.z);
5✔
1066
        self.w.mul_assign(rhs.w);
5✔
1067
    }
1068
}
1069

1070
impl MulAssign<&Self> for USizeVec4 {
1071
    #[inline]
1072
    fn mul_assign(&mut self, rhs: &Self) {
3✔
1073
        self.mul_assign(*rhs);
3✔
1074
    }
1075
}
1076

1077
impl Mul<usize> for USizeVec4 {
1078
    type Output = Self;
1079
    #[inline]
1080
    fn mul(self, rhs: usize) -> Self {
3✔
1081
        Self {
1082
            x: self.x.mul(rhs),
3✔
1083
            y: self.y.mul(rhs),
3✔
1084
            z: self.z.mul(rhs),
3✔
1085
            w: self.w.mul(rhs),
3✔
1086
        }
1087
    }
1088
}
1089

1090
impl Mul<&usize> for USizeVec4 {
1091
    type Output = Self;
1092
    #[inline]
1093
    fn mul(self, rhs: &usize) -> Self {
3✔
1094
        self.mul(*rhs)
3✔
1095
    }
1096
}
1097

1098
impl Mul<&usize> for &USizeVec4 {
1099
    type Output = USizeVec4;
1100
    #[inline]
1101
    fn mul(self, rhs: &usize) -> USizeVec4 {
3✔
1102
        (*self).mul(*rhs)
3✔
1103
    }
1104
}
1105

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

1114
impl MulAssign<usize> for USizeVec4 {
1115
    #[inline]
1116
    fn mul_assign(&mut self, rhs: usize) {
3✔
1117
        self.x.mul_assign(rhs);
3✔
1118
        self.y.mul_assign(rhs);
3✔
1119
        self.z.mul_assign(rhs);
3✔
1120
        self.w.mul_assign(rhs);
3✔
1121
    }
1122
}
1123

1124
impl MulAssign<&usize> for USizeVec4 {
1125
    #[inline]
1126
    fn mul_assign(&mut self, rhs: &usize) {
3✔
1127
        self.mul_assign(*rhs);
3✔
1128
    }
1129
}
1130

1131
impl Mul<USizeVec4> for usize {
1132
    type Output = USizeVec4;
1133
    #[inline]
1134
    fn mul(self, rhs: USizeVec4) -> USizeVec4 {
3✔
1135
        USizeVec4 {
1136
            x: self.mul(rhs.x),
3✔
1137
            y: self.mul(rhs.y),
3✔
1138
            z: self.mul(rhs.z),
3✔
1139
            w: self.mul(rhs.w),
3✔
1140
        }
1141
    }
1142
}
1143

1144
impl Mul<&USizeVec4> for usize {
1145
    type Output = USizeVec4;
1146
    #[inline]
1147
    fn mul(self, rhs: &USizeVec4) -> USizeVec4 {
3✔
1148
        self.mul(*rhs)
3✔
1149
    }
1150
}
1151

1152
impl Mul<&USizeVec4> for &usize {
1153
    type Output = USizeVec4;
1154
    #[inline]
1155
    fn mul(self, rhs: &USizeVec4) -> USizeVec4 {
3✔
1156
        (*self).mul(*rhs)
3✔
1157
    }
1158
}
1159

1160
impl Mul<USizeVec4> for &usize {
1161
    type Output = USizeVec4;
1162
    #[inline]
1163
    fn mul(self, rhs: USizeVec4) -> USizeVec4 {
3✔
1164
        (*self).mul(rhs)
3✔
1165
    }
1166
}
1167

1168
impl Add for USizeVec4 {
1169
    type Output = Self;
1170
    #[inline]
1171
    fn add(self, rhs: Self) -> Self {
3✔
1172
        Self {
1173
            x: self.x.add(rhs.x),
3✔
1174
            y: self.y.add(rhs.y),
3✔
1175
            z: self.z.add(rhs.z),
3✔
1176
            w: self.w.add(rhs.w),
3✔
1177
        }
1178
    }
1179
}
1180

1181
impl Add<&Self> for USizeVec4 {
1182
    type Output = Self;
1183
    #[inline]
1184
    fn add(self, rhs: &Self) -> Self {
3✔
1185
        self.add(*rhs)
3✔
1186
    }
1187
}
1188

1189
impl Add<&USizeVec4> for &USizeVec4 {
1190
    type Output = USizeVec4;
1191
    #[inline]
1192
    fn add(self, rhs: &USizeVec4) -> USizeVec4 {
3✔
1193
        (*self).add(*rhs)
3✔
1194
    }
1195
}
1196

1197
impl Add<USizeVec4> for &USizeVec4 {
1198
    type Output = USizeVec4;
1199
    #[inline]
1200
    fn add(self, rhs: USizeVec4) -> USizeVec4 {
3✔
1201
        (*self).add(rhs)
3✔
1202
    }
1203
}
1204

1205
impl AddAssign for USizeVec4 {
1206
    #[inline]
1207
    fn add_assign(&mut self, rhs: Self) {
3✔
1208
        self.x.add_assign(rhs.x);
3✔
1209
        self.y.add_assign(rhs.y);
5✔
1210
        self.z.add_assign(rhs.z);
5✔
1211
        self.w.add_assign(rhs.w);
5✔
1212
    }
1213
}
1214

1215
impl AddAssign<&Self> for USizeVec4 {
1216
    #[inline]
1217
    fn add_assign(&mut self, rhs: &Self) {
3✔
1218
        self.add_assign(*rhs);
3✔
1219
    }
1220
}
1221

1222
impl Add<usize> for USizeVec4 {
1223
    type Output = Self;
1224
    #[inline]
1225
    fn add(self, rhs: usize) -> Self {
3✔
1226
        Self {
1227
            x: self.x.add(rhs),
3✔
1228
            y: self.y.add(rhs),
3✔
1229
            z: self.z.add(rhs),
3✔
1230
            w: self.w.add(rhs),
3✔
1231
        }
1232
    }
1233
}
1234

1235
impl Add<&usize> for USizeVec4 {
1236
    type Output = Self;
1237
    #[inline]
1238
    fn add(self, rhs: &usize) -> Self {
3✔
1239
        self.add(*rhs)
3✔
1240
    }
1241
}
1242

1243
impl Add<&usize> for &USizeVec4 {
1244
    type Output = USizeVec4;
1245
    #[inline]
1246
    fn add(self, rhs: &usize) -> USizeVec4 {
3✔
1247
        (*self).add(*rhs)
3✔
1248
    }
1249
}
1250

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

1259
impl AddAssign<usize> for USizeVec4 {
1260
    #[inline]
1261
    fn add_assign(&mut self, rhs: usize) {
3✔
1262
        self.x.add_assign(rhs);
3✔
1263
        self.y.add_assign(rhs);
3✔
1264
        self.z.add_assign(rhs);
3✔
1265
        self.w.add_assign(rhs);
3✔
1266
    }
1267
}
1268

1269
impl AddAssign<&usize> for USizeVec4 {
1270
    #[inline]
1271
    fn add_assign(&mut self, rhs: &usize) {
3✔
1272
        self.add_assign(*rhs);
3✔
1273
    }
1274
}
1275

1276
impl Add<USizeVec4> for usize {
1277
    type Output = USizeVec4;
1278
    #[inline]
1279
    fn add(self, rhs: USizeVec4) -> USizeVec4 {
3✔
1280
        USizeVec4 {
1281
            x: self.add(rhs.x),
3✔
1282
            y: self.add(rhs.y),
3✔
1283
            z: self.add(rhs.z),
3✔
1284
            w: self.add(rhs.w),
3✔
1285
        }
1286
    }
1287
}
1288

1289
impl Add<&USizeVec4> for usize {
1290
    type Output = USizeVec4;
1291
    #[inline]
1292
    fn add(self, rhs: &USizeVec4) -> USizeVec4 {
3✔
1293
        self.add(*rhs)
3✔
1294
    }
1295
}
1296

1297
impl Add<&USizeVec4> for &usize {
1298
    type Output = USizeVec4;
1299
    #[inline]
1300
    fn add(self, rhs: &USizeVec4) -> USizeVec4 {
3✔
1301
        (*self).add(*rhs)
3✔
1302
    }
1303
}
1304

1305
impl Add<USizeVec4> for &usize {
1306
    type Output = USizeVec4;
1307
    #[inline]
1308
    fn add(self, rhs: USizeVec4) -> USizeVec4 {
3✔
1309
        (*self).add(rhs)
3✔
1310
    }
1311
}
1312

1313
impl Sub for USizeVec4 {
1314
    type Output = Self;
1315
    #[inline]
1316
    fn sub(self, rhs: Self) -> Self {
3✔
1317
        Self {
1318
            x: self.x.sub(rhs.x),
3✔
1319
            y: self.y.sub(rhs.y),
3✔
1320
            z: self.z.sub(rhs.z),
3✔
1321
            w: self.w.sub(rhs.w),
3✔
1322
        }
1323
    }
1324
}
1325

1326
impl Sub<&Self> for USizeVec4 {
1327
    type Output = Self;
1328
    #[inline]
1329
    fn sub(self, rhs: &Self) -> Self {
3✔
1330
        self.sub(*rhs)
3✔
1331
    }
1332
}
1333

1334
impl Sub<&USizeVec4> for &USizeVec4 {
1335
    type Output = USizeVec4;
1336
    #[inline]
1337
    fn sub(self, rhs: &USizeVec4) -> USizeVec4 {
3✔
1338
        (*self).sub(*rhs)
3✔
1339
    }
1340
}
1341

1342
impl Sub<USizeVec4> for &USizeVec4 {
1343
    type Output = USizeVec4;
1344
    #[inline]
1345
    fn sub(self, rhs: USizeVec4) -> USizeVec4 {
3✔
1346
        (*self).sub(rhs)
3✔
1347
    }
1348
}
1349

1350
impl SubAssign for USizeVec4 {
1351
    #[inline]
1352
    fn sub_assign(&mut self, rhs: Self) {
3✔
1353
        self.x.sub_assign(rhs.x);
3✔
1354
        self.y.sub_assign(rhs.y);
5✔
1355
        self.z.sub_assign(rhs.z);
5✔
1356
        self.w.sub_assign(rhs.w);
5✔
1357
    }
1358
}
1359

1360
impl SubAssign<&Self> for USizeVec4 {
1361
    #[inline]
1362
    fn sub_assign(&mut self, rhs: &Self) {
3✔
1363
        self.sub_assign(*rhs);
3✔
1364
    }
1365
}
1366

1367
impl Sub<usize> for USizeVec4 {
1368
    type Output = Self;
1369
    #[inline]
1370
    fn sub(self, rhs: usize) -> Self {
3✔
1371
        Self {
1372
            x: self.x.sub(rhs),
3✔
1373
            y: self.y.sub(rhs),
3✔
1374
            z: self.z.sub(rhs),
3✔
1375
            w: self.w.sub(rhs),
3✔
1376
        }
1377
    }
1378
}
1379

1380
impl Sub<&usize> for USizeVec4 {
1381
    type Output = Self;
1382
    #[inline]
1383
    fn sub(self, rhs: &usize) -> Self {
3✔
1384
        self.sub(*rhs)
3✔
1385
    }
1386
}
1387

1388
impl Sub<&usize> for &USizeVec4 {
1389
    type Output = USizeVec4;
1390
    #[inline]
1391
    fn sub(self, rhs: &usize) -> USizeVec4 {
3✔
1392
        (*self).sub(*rhs)
3✔
1393
    }
1394
}
1395

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

1404
impl SubAssign<usize> for USizeVec4 {
1405
    #[inline]
1406
    fn sub_assign(&mut self, rhs: usize) {
3✔
1407
        self.x.sub_assign(rhs);
3✔
1408
        self.y.sub_assign(rhs);
3✔
1409
        self.z.sub_assign(rhs);
3✔
1410
        self.w.sub_assign(rhs);
3✔
1411
    }
1412
}
1413

1414
impl SubAssign<&usize> for USizeVec4 {
1415
    #[inline]
1416
    fn sub_assign(&mut self, rhs: &usize) {
3✔
1417
        self.sub_assign(*rhs);
3✔
1418
    }
1419
}
1420

1421
impl Sub<USizeVec4> for usize {
1422
    type Output = USizeVec4;
1423
    #[inline]
1424
    fn sub(self, rhs: USizeVec4) -> USizeVec4 {
3✔
1425
        USizeVec4 {
1426
            x: self.sub(rhs.x),
3✔
1427
            y: self.sub(rhs.y),
3✔
1428
            z: self.sub(rhs.z),
3✔
1429
            w: self.sub(rhs.w),
3✔
1430
        }
1431
    }
1432
}
1433

1434
impl Sub<&USizeVec4> for usize {
1435
    type Output = USizeVec4;
1436
    #[inline]
1437
    fn sub(self, rhs: &USizeVec4) -> USizeVec4 {
3✔
1438
        self.sub(*rhs)
3✔
1439
    }
1440
}
1441

1442
impl Sub<&USizeVec4> for &usize {
1443
    type Output = USizeVec4;
1444
    #[inline]
1445
    fn sub(self, rhs: &USizeVec4) -> USizeVec4 {
3✔
1446
        (*self).sub(*rhs)
3✔
1447
    }
1448
}
1449

1450
impl Sub<USizeVec4> for &usize {
1451
    type Output = USizeVec4;
1452
    #[inline]
1453
    fn sub(self, rhs: USizeVec4) -> USizeVec4 {
3✔
1454
        (*self).sub(rhs)
3✔
1455
    }
1456
}
1457

1458
impl Rem for USizeVec4 {
1459
    type Output = Self;
1460
    #[inline]
1461
    fn rem(self, rhs: Self) -> Self {
3✔
1462
        Self {
1463
            x: self.x.rem(rhs.x),
3✔
1464
            y: self.y.rem(rhs.y),
3✔
1465
            z: self.z.rem(rhs.z),
3✔
1466
            w: self.w.rem(rhs.w),
3✔
1467
        }
1468
    }
1469
}
1470

1471
impl Rem<&Self> for USizeVec4 {
1472
    type Output = Self;
1473
    #[inline]
1474
    fn rem(self, rhs: &Self) -> Self {
3✔
1475
        self.rem(*rhs)
3✔
1476
    }
1477
}
1478

1479
impl Rem<&USizeVec4> for &USizeVec4 {
1480
    type Output = USizeVec4;
1481
    #[inline]
1482
    fn rem(self, rhs: &USizeVec4) -> USizeVec4 {
3✔
1483
        (*self).rem(*rhs)
3✔
1484
    }
1485
}
1486

1487
impl Rem<USizeVec4> for &USizeVec4 {
1488
    type Output = USizeVec4;
1489
    #[inline]
1490
    fn rem(self, rhs: USizeVec4) -> USizeVec4 {
3✔
1491
        (*self).rem(rhs)
3✔
1492
    }
1493
}
1494

1495
impl RemAssign for USizeVec4 {
1496
    #[inline]
1497
    fn rem_assign(&mut self, rhs: Self) {
3✔
1498
        self.x.rem_assign(rhs.x);
3✔
1499
        self.y.rem_assign(rhs.y);
3✔
1500
        self.z.rem_assign(rhs.z);
4✔
1501
        self.w.rem_assign(rhs.w);
4✔
1502
    }
1503
}
1504

1505
impl RemAssign<&Self> for USizeVec4 {
1506
    #[inline]
1507
    fn rem_assign(&mut self, rhs: &Self) {
3✔
1508
        self.rem_assign(*rhs);
3✔
1509
    }
1510
}
1511

1512
impl Rem<usize> for USizeVec4 {
1513
    type Output = Self;
1514
    #[inline]
1515
    fn rem(self, rhs: usize) -> Self {
3✔
1516
        Self {
1517
            x: self.x.rem(rhs),
3✔
1518
            y: self.y.rem(rhs),
3✔
1519
            z: self.z.rem(rhs),
3✔
1520
            w: self.w.rem(rhs),
3✔
1521
        }
1522
    }
1523
}
1524

1525
impl Rem<&usize> for USizeVec4 {
1526
    type Output = Self;
1527
    #[inline]
1528
    fn rem(self, rhs: &usize) -> Self {
3✔
1529
        self.rem(*rhs)
3✔
1530
    }
1531
}
1532

1533
impl Rem<&usize> for &USizeVec4 {
1534
    type Output = USizeVec4;
1535
    #[inline]
1536
    fn rem(self, rhs: &usize) -> USizeVec4 {
3✔
1537
        (*self).rem(*rhs)
3✔
1538
    }
1539
}
1540

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

1549
impl RemAssign<usize> for USizeVec4 {
1550
    #[inline]
1551
    fn rem_assign(&mut self, rhs: usize) {
3✔
1552
        self.x.rem_assign(rhs);
3✔
1553
        self.y.rem_assign(rhs);
3✔
1554
        self.z.rem_assign(rhs);
3✔
1555
        self.w.rem_assign(rhs);
4✔
1556
    }
1557
}
1558

1559
impl RemAssign<&usize> for USizeVec4 {
1560
    #[inline]
1561
    fn rem_assign(&mut self, rhs: &usize) {
3✔
1562
        self.rem_assign(*rhs);
3✔
1563
    }
1564
}
1565

1566
impl Rem<USizeVec4> for usize {
1567
    type Output = USizeVec4;
1568
    #[inline]
1569
    fn rem(self, rhs: USizeVec4) -> USizeVec4 {
3✔
1570
        USizeVec4 {
1571
            x: self.rem(rhs.x),
3✔
1572
            y: self.rem(rhs.y),
3✔
1573
            z: self.rem(rhs.z),
3✔
1574
            w: self.rem(rhs.w),
3✔
1575
        }
1576
    }
1577
}
1578

1579
impl Rem<&USizeVec4> for usize {
1580
    type Output = USizeVec4;
1581
    #[inline]
1582
    fn rem(self, rhs: &USizeVec4) -> USizeVec4 {
3✔
1583
        self.rem(*rhs)
3✔
1584
    }
1585
}
1586

1587
impl Rem<&USizeVec4> for &usize {
1588
    type Output = USizeVec4;
1589
    #[inline]
1590
    fn rem(self, rhs: &USizeVec4) -> USizeVec4 {
3✔
1591
        (*self).rem(*rhs)
3✔
1592
    }
1593
}
1594

1595
impl Rem<USizeVec4> for &usize {
1596
    type Output = USizeVec4;
1597
    #[inline]
1598
    fn rem(self, rhs: USizeVec4) -> USizeVec4 {
3✔
1599
        (*self).rem(rhs)
3✔
1600
    }
1601
}
1602

1603
impl AsRef<[usize; 4]> for USizeVec4 {
1604
    #[inline]
1605
    fn as_ref(&self) -> &[usize; 4] {
3✔
1606
        unsafe { &*(self as *const Self as *const [usize; 4]) }
3✔
1607
    }
1608
}
1609

1610
impl AsMut<[usize; 4]> for USizeVec4 {
1611
    #[inline]
1612
    fn as_mut(&mut self) -> &mut [usize; 4] {
3✔
1613
        unsafe { &mut *(self as *mut Self as *mut [usize; 4]) }
3✔
1614
    }
1615
}
1616

1617
impl Sum for USizeVec4 {
1618
    #[inline]
1619
    fn sum<I>(iter: I) -> Self
3✔
1620
    where
1621
        I: Iterator<Item = Self>,
1622
    {
1623
        iter.fold(Self::ZERO, Self::add)
3✔
1624
    }
1625
}
1626

1627
impl<'a> Sum<&'a Self> for USizeVec4 {
1628
    #[inline]
1629
    fn sum<I>(iter: I) -> Self
3✔
1630
    where
1631
        I: Iterator<Item = &'a Self>,
1632
    {
1633
        iter.fold(Self::ZERO, |a, &b| Self::add(a, b))
9✔
1634
    }
1635
}
1636

1637
impl Product for USizeVec4 {
1638
    #[inline]
1639
    fn product<I>(iter: I) -> Self
3✔
1640
    where
1641
        I: Iterator<Item = Self>,
1642
    {
1643
        iter.fold(Self::ONE, Self::mul)
3✔
1644
    }
1645
}
1646

1647
impl<'a> Product<&'a Self> for USizeVec4 {
1648
    #[inline]
1649
    fn product<I>(iter: I) -> Self
3✔
1650
    where
1651
        I: Iterator<Item = &'a Self>,
1652
    {
1653
        iter.fold(Self::ONE, |a, &b| Self::mul(a, b))
9✔
1654
    }
1655
}
1656

1657
impl Not for USizeVec4 {
1658
    type Output = Self;
1659
    #[inline]
1660
    fn not(self) -> Self {
3✔
1661
        Self {
1662
            x: self.x.not(),
3✔
1663
            y: self.y.not(),
3✔
1664
            z: self.z.not(),
3✔
1665
            w: self.w.not(),
3✔
1666
        }
1667
    }
1668
}
1669

1670
impl Not for &USizeVec4 {
1671
    type Output = USizeVec4;
1672
    #[inline]
1673
    fn not(self) -> USizeVec4 {
3✔
1674
        (*self).not()
3✔
1675
    }
1676
}
1677

1678
impl BitAnd for USizeVec4 {
1679
    type Output = Self;
1680
    #[inline]
1681
    fn bitand(self, rhs: Self) -> Self::Output {
3✔
1682
        Self {
1683
            x: self.x.bitand(rhs.x),
3✔
1684
            y: self.y.bitand(rhs.y),
3✔
1685
            z: self.z.bitand(rhs.z),
3✔
1686
            w: self.w.bitand(rhs.w),
3✔
1687
        }
1688
    }
1689
}
1690

1691
impl BitAnd<&Self> for USizeVec4 {
1692
    type Output = Self;
1693
    #[inline]
1694
    fn bitand(self, rhs: &Self) -> Self {
3✔
1695
        self.bitand(*rhs)
3✔
1696
    }
1697
}
1698

1699
impl BitAnd<&USizeVec4> for &USizeVec4 {
1700
    type Output = USizeVec4;
1701
    #[inline]
1702
    fn bitand(self, rhs: &USizeVec4) -> USizeVec4 {
3✔
1703
        (*self).bitand(*rhs)
3✔
1704
    }
1705
}
1706

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

1715
impl BitAndAssign for USizeVec4 {
1716
    #[inline]
1717
    fn bitand_assign(&mut self, rhs: Self) {
3✔
1718
        *self = self.bitand(rhs);
3✔
1719
    }
1720
}
1721

1722
impl BitAndAssign<&Self> for USizeVec4 {
1723
    #[inline]
1724
    fn bitand_assign(&mut self, rhs: &Self) {
3✔
1725
        self.bitand_assign(*rhs);
3✔
1726
    }
1727
}
1728

1729
impl BitOr for USizeVec4 {
1730
    type Output = Self;
1731
    #[inline]
1732
    fn bitor(self, rhs: Self) -> Self::Output {
3✔
1733
        Self {
1734
            x: self.x.bitor(rhs.x),
3✔
1735
            y: self.y.bitor(rhs.y),
3✔
1736
            z: self.z.bitor(rhs.z),
3✔
1737
            w: self.w.bitor(rhs.w),
3✔
1738
        }
1739
    }
1740
}
1741

1742
impl BitOr<&Self> for USizeVec4 {
1743
    type Output = Self;
1744
    #[inline]
1745
    fn bitor(self, rhs: &Self) -> Self {
3✔
1746
        self.bitor(*rhs)
3✔
1747
    }
1748
}
1749

1750
impl BitOr<&USizeVec4> for &USizeVec4 {
1751
    type Output = USizeVec4;
1752
    #[inline]
1753
    fn bitor(self, rhs: &USizeVec4) -> USizeVec4 {
3✔
1754
        (*self).bitor(*rhs)
3✔
1755
    }
1756
}
1757

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

1766
impl BitOrAssign for USizeVec4 {
1767
    #[inline]
1768
    fn bitor_assign(&mut self, rhs: Self) {
3✔
1769
        *self = self.bitor(rhs);
3✔
1770
    }
1771
}
1772

1773
impl BitOrAssign<&Self> for USizeVec4 {
1774
    #[inline]
1775
    fn bitor_assign(&mut self, rhs: &Self) {
3✔
1776
        self.bitor_assign(*rhs);
3✔
1777
    }
1778
}
1779

1780
impl BitXor for USizeVec4 {
1781
    type Output = Self;
1782
    #[inline]
1783
    fn bitxor(self, rhs: Self) -> Self::Output {
3✔
1784
        Self {
1785
            x: self.x.bitxor(rhs.x),
3✔
1786
            y: self.y.bitxor(rhs.y),
3✔
1787
            z: self.z.bitxor(rhs.z),
3✔
1788
            w: self.w.bitxor(rhs.w),
3✔
1789
        }
1790
    }
1791
}
1792

1793
impl BitXor<&Self> for USizeVec4 {
1794
    type Output = Self;
1795
    #[inline]
1796
    fn bitxor(self, rhs: &Self) -> Self {
3✔
1797
        self.bitxor(*rhs)
3✔
1798
    }
1799
}
1800

1801
impl BitXor<&USizeVec4> for &USizeVec4 {
1802
    type Output = USizeVec4;
1803
    #[inline]
1804
    fn bitxor(self, rhs: &USizeVec4) -> USizeVec4 {
3✔
1805
        (*self).bitxor(*rhs)
3✔
1806
    }
1807
}
1808

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

1817
impl BitXorAssign for USizeVec4 {
1818
    #[inline]
1819
    fn bitxor_assign(&mut self, rhs: Self) {
3✔
1820
        *self = self.bitxor(rhs);
3✔
1821
    }
1822
}
1823

1824
impl BitXorAssign<&Self> for USizeVec4 {
1825
    #[inline]
1826
    fn bitxor_assign(&mut self, rhs: &Self) {
3✔
1827
        self.bitxor_assign(*rhs);
3✔
1828
    }
1829
}
1830

1831
impl BitAnd<usize> for USizeVec4 {
1832
    type Output = Self;
1833
    #[inline]
1834
    fn bitand(self, rhs: usize) -> Self::Output {
3✔
1835
        Self {
1836
            x: self.x.bitand(rhs),
3✔
1837
            y: self.y.bitand(rhs),
3✔
1838
            z: self.z.bitand(rhs),
3✔
1839
            w: self.w.bitand(rhs),
3✔
1840
        }
1841
    }
1842
}
1843

1844
impl BitAnd<&usize> for USizeVec4 {
1845
    type Output = Self;
1846
    #[inline]
1847
    fn bitand(self, rhs: &usize) -> Self {
3✔
1848
        self.bitand(*rhs)
3✔
1849
    }
1850
}
1851

1852
impl BitAnd<&usize> for &USizeVec4 {
1853
    type Output = USizeVec4;
1854
    #[inline]
1855
    fn bitand(self, rhs: &usize) -> USizeVec4 {
3✔
1856
        (*self).bitand(*rhs)
3✔
1857
    }
1858
}
1859

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

1868
impl BitAndAssign<usize> for USizeVec4 {
1869
    #[inline]
1870
    fn bitand_assign(&mut self, rhs: usize) {
3✔
1871
        *self = self.bitand(rhs);
3✔
1872
    }
1873
}
1874

1875
impl BitAndAssign<&usize> for USizeVec4 {
1876
    #[inline]
1877
    fn bitand_assign(&mut self, rhs: &usize) {
3✔
1878
        self.bitand_assign(*rhs);
3✔
1879
    }
1880
}
1881

1882
impl BitOr<usize> for USizeVec4 {
1883
    type Output = Self;
1884
    #[inline]
1885
    fn bitor(self, rhs: usize) -> Self::Output {
3✔
1886
        Self {
1887
            x: self.x.bitor(rhs),
3✔
1888
            y: self.y.bitor(rhs),
3✔
1889
            z: self.z.bitor(rhs),
3✔
1890
            w: self.w.bitor(rhs),
3✔
1891
        }
1892
    }
1893
}
1894

1895
impl BitOr<&usize> for USizeVec4 {
1896
    type Output = Self;
1897
    #[inline]
1898
    fn bitor(self, rhs: &usize) -> Self {
3✔
1899
        self.bitor(*rhs)
3✔
1900
    }
1901
}
1902

1903
impl BitOr<&usize> for &USizeVec4 {
1904
    type Output = USizeVec4;
1905
    #[inline]
1906
    fn bitor(self, rhs: &usize) -> USizeVec4 {
3✔
1907
        (*self).bitor(*rhs)
3✔
1908
    }
1909
}
1910

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

1919
impl BitOrAssign<usize> for USizeVec4 {
1920
    #[inline]
1921
    fn bitor_assign(&mut self, rhs: usize) {
3✔
1922
        *self = self.bitor(rhs);
3✔
1923
    }
1924
}
1925

1926
impl BitOrAssign<&usize> for USizeVec4 {
1927
    #[inline]
1928
    fn bitor_assign(&mut self, rhs: &usize) {
3✔
1929
        self.bitor_assign(*rhs);
3✔
1930
    }
1931
}
1932

1933
impl BitXor<usize> for USizeVec4 {
1934
    type Output = Self;
1935
    #[inline]
1936
    fn bitxor(self, rhs: usize) -> Self::Output {
3✔
1937
        Self {
1938
            x: self.x.bitxor(rhs),
3✔
1939
            y: self.y.bitxor(rhs),
3✔
1940
            z: self.z.bitxor(rhs),
3✔
1941
            w: self.w.bitxor(rhs),
3✔
1942
        }
1943
    }
1944
}
1945

1946
impl BitXor<&usize> for USizeVec4 {
1947
    type Output = Self;
1948
    #[inline]
1949
    fn bitxor(self, rhs: &usize) -> Self {
3✔
1950
        self.bitxor(*rhs)
3✔
1951
    }
1952
}
1953

1954
impl BitXor<&usize> for &USizeVec4 {
1955
    type Output = USizeVec4;
1956
    #[inline]
1957
    fn bitxor(self, rhs: &usize) -> USizeVec4 {
3✔
1958
        (*self).bitxor(*rhs)
3✔
1959
    }
1960
}
1961

1962
impl BitXor<usize> for &USizeVec4 {
1963
    type Output = USizeVec4;
1964
    #[inline]
1965
    fn bitxor(self, rhs: usize) -> USizeVec4 {
3✔
1966
        (*self).bitxor(rhs)
3✔
1967
    }
1968
}
1969

1970
impl BitXorAssign<usize> for USizeVec4 {
1971
    #[inline]
1972
    fn bitxor_assign(&mut self, rhs: usize) {
3✔
1973
        *self = self.bitxor(rhs);
3✔
1974
    }
1975
}
1976

1977
impl BitXorAssign<&usize> for USizeVec4 {
1978
    #[inline]
1979
    fn bitxor_assign(&mut self, rhs: &usize) {
3✔
1980
        self.bitxor_assign(*rhs);
3✔
1981
    }
1982
}
1983

1984
impl Shl<i8> for USizeVec4 {
1985
    type Output = Self;
1986
    #[inline]
1987
    fn shl(self, rhs: i8) -> Self::Output {
3✔
1988
        Self {
1989
            x: self.x.shl(rhs),
3✔
1990
            y: self.y.shl(rhs),
3✔
1991
            z: self.z.shl(rhs),
3✔
1992
            w: self.w.shl(rhs),
3✔
1993
        }
1994
    }
1995
}
1996

1997
impl Shl<&i8> for USizeVec4 {
1998
    type Output = Self;
1999
    #[inline]
2000
    fn shl(self, rhs: &i8) -> Self {
3✔
2001
        self.shl(*rhs)
3✔
2002
    }
2003
}
2004

2005
impl Shl<&i8> for &USizeVec4 {
2006
    type Output = USizeVec4;
2007
    #[inline]
2008
    fn shl(self, rhs: &i8) -> USizeVec4 {
3✔
2009
        (*self).shl(*rhs)
3✔
2010
    }
2011
}
2012

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

2021
impl ShlAssign<i8> for USizeVec4 {
2022
    #[inline]
2023
    fn shl_assign(&mut self, rhs: i8) {
3✔
2024
        *self = self.shl(rhs);
3✔
2025
    }
2026
}
2027

2028
impl ShlAssign<&i8> for USizeVec4 {
2029
    #[inline]
2030
    fn shl_assign(&mut self, rhs: &i8) {
3✔
2031
        self.shl_assign(*rhs);
3✔
2032
    }
2033
}
2034

2035
impl Shr<i8> for USizeVec4 {
2036
    type Output = Self;
2037
    #[inline]
2038
    fn shr(self, rhs: i8) -> Self::Output {
3✔
2039
        Self {
2040
            x: self.x.shr(rhs),
3✔
2041
            y: self.y.shr(rhs),
3✔
2042
            z: self.z.shr(rhs),
3✔
2043
            w: self.w.shr(rhs),
3✔
2044
        }
2045
    }
2046
}
2047

2048
impl Shr<&i8> for USizeVec4 {
2049
    type Output = Self;
2050
    #[inline]
2051
    fn shr(self, rhs: &i8) -> Self {
3✔
2052
        self.shr(*rhs)
3✔
2053
    }
2054
}
2055

2056
impl Shr<&i8> for &USizeVec4 {
2057
    type Output = USizeVec4;
2058
    #[inline]
2059
    fn shr(self, rhs: &i8) -> USizeVec4 {
3✔
2060
        (*self).shr(*rhs)
3✔
2061
    }
2062
}
2063

2064
impl Shr<i8> for &USizeVec4 {
2065
    type Output = USizeVec4;
2066
    #[inline]
2067
    fn shr(self, rhs: i8) -> USizeVec4 {
3✔
2068
        (*self).shr(rhs)
3✔
2069
    }
2070
}
2071

2072
impl ShrAssign<i8> for USizeVec4 {
2073
    #[inline]
2074
    fn shr_assign(&mut self, rhs: i8) {
3✔
2075
        *self = self.shr(rhs);
3✔
2076
    }
2077
}
2078

2079
impl ShrAssign<&i8> for USizeVec4 {
2080
    #[inline]
2081
    fn shr_assign(&mut self, rhs: &i8) {
3✔
2082
        self.shr_assign(*rhs);
3✔
2083
    }
2084
}
2085

2086
impl Shl<i16> for USizeVec4 {
2087
    type Output = Self;
2088
    #[inline]
2089
    fn shl(self, rhs: i16) -> Self::Output {
3✔
2090
        Self {
2091
            x: self.x.shl(rhs),
3✔
2092
            y: self.y.shl(rhs),
3✔
2093
            z: self.z.shl(rhs),
3✔
2094
            w: self.w.shl(rhs),
3✔
2095
        }
2096
    }
2097
}
2098

2099
impl Shl<&i16> for USizeVec4 {
2100
    type Output = Self;
2101
    #[inline]
2102
    fn shl(self, rhs: &i16) -> Self {
3✔
2103
        self.shl(*rhs)
3✔
2104
    }
2105
}
2106

2107
impl Shl<&i16> for &USizeVec4 {
2108
    type Output = USizeVec4;
2109
    #[inline]
2110
    fn shl(self, rhs: &i16) -> USizeVec4 {
3✔
2111
        (*self).shl(*rhs)
3✔
2112
    }
2113
}
2114

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

2123
impl ShlAssign<i16> for USizeVec4 {
2124
    #[inline]
2125
    fn shl_assign(&mut self, rhs: i16) {
3✔
2126
        *self = self.shl(rhs);
3✔
2127
    }
2128
}
2129

2130
impl ShlAssign<&i16> for USizeVec4 {
2131
    #[inline]
2132
    fn shl_assign(&mut self, rhs: &i16) {
3✔
2133
        self.shl_assign(*rhs);
3✔
2134
    }
2135
}
2136

2137
impl Shr<i16> for USizeVec4 {
2138
    type Output = Self;
2139
    #[inline]
2140
    fn shr(self, rhs: i16) -> Self::Output {
3✔
2141
        Self {
2142
            x: self.x.shr(rhs),
3✔
2143
            y: self.y.shr(rhs),
3✔
2144
            z: self.z.shr(rhs),
3✔
2145
            w: self.w.shr(rhs),
3✔
2146
        }
2147
    }
2148
}
2149

2150
impl Shr<&i16> for USizeVec4 {
2151
    type Output = Self;
2152
    #[inline]
2153
    fn shr(self, rhs: &i16) -> Self {
3✔
2154
        self.shr(*rhs)
3✔
2155
    }
2156
}
2157

2158
impl Shr<&i16> for &USizeVec4 {
2159
    type Output = USizeVec4;
2160
    #[inline]
2161
    fn shr(self, rhs: &i16) -> USizeVec4 {
3✔
2162
        (*self).shr(*rhs)
3✔
2163
    }
2164
}
2165

2166
impl Shr<i16> for &USizeVec4 {
2167
    type Output = USizeVec4;
2168
    #[inline]
2169
    fn shr(self, rhs: i16) -> USizeVec4 {
3✔
2170
        (*self).shr(rhs)
3✔
2171
    }
2172
}
2173

2174
impl ShrAssign<i16> for USizeVec4 {
2175
    #[inline]
2176
    fn shr_assign(&mut self, rhs: i16) {
3✔
2177
        *self = self.shr(rhs);
3✔
2178
    }
2179
}
2180

2181
impl ShrAssign<&i16> for USizeVec4 {
2182
    #[inline]
2183
    fn shr_assign(&mut self, rhs: &i16) {
3✔
2184
        self.shr_assign(*rhs);
3✔
2185
    }
2186
}
2187

2188
impl Shl<i32> for USizeVec4 {
2189
    type Output = Self;
2190
    #[inline]
2191
    fn shl(self, rhs: i32) -> Self::Output {
3✔
2192
        Self {
2193
            x: self.x.shl(rhs),
3✔
2194
            y: self.y.shl(rhs),
3✔
2195
            z: self.z.shl(rhs),
3✔
2196
            w: self.w.shl(rhs),
3✔
2197
        }
2198
    }
2199
}
2200

2201
impl Shl<&i32> for USizeVec4 {
2202
    type Output = Self;
2203
    #[inline]
2204
    fn shl(self, rhs: &i32) -> Self {
3✔
2205
        self.shl(*rhs)
3✔
2206
    }
2207
}
2208

2209
impl Shl<&i32> for &USizeVec4 {
2210
    type Output = USizeVec4;
2211
    #[inline]
2212
    fn shl(self, rhs: &i32) -> USizeVec4 {
3✔
2213
        (*self).shl(*rhs)
3✔
2214
    }
2215
}
2216

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

2225
impl ShlAssign<i32> for USizeVec4 {
2226
    #[inline]
2227
    fn shl_assign(&mut self, rhs: i32) {
3✔
2228
        *self = self.shl(rhs);
3✔
2229
    }
2230
}
2231

2232
impl ShlAssign<&i32> for USizeVec4 {
2233
    #[inline]
2234
    fn shl_assign(&mut self, rhs: &i32) {
3✔
2235
        self.shl_assign(*rhs);
3✔
2236
    }
2237
}
2238

2239
impl Shr<i32> for USizeVec4 {
2240
    type Output = Self;
2241
    #[inline]
2242
    fn shr(self, rhs: i32) -> Self::Output {
3✔
2243
        Self {
2244
            x: self.x.shr(rhs),
3✔
2245
            y: self.y.shr(rhs),
3✔
2246
            z: self.z.shr(rhs),
3✔
2247
            w: self.w.shr(rhs),
3✔
2248
        }
2249
    }
2250
}
2251

2252
impl Shr<&i32> for USizeVec4 {
2253
    type Output = Self;
2254
    #[inline]
2255
    fn shr(self, rhs: &i32) -> Self {
3✔
2256
        self.shr(*rhs)
3✔
2257
    }
2258
}
2259

2260
impl Shr<&i32> for &USizeVec4 {
2261
    type Output = USizeVec4;
2262
    #[inline]
2263
    fn shr(self, rhs: &i32) -> USizeVec4 {
3✔
2264
        (*self).shr(*rhs)
3✔
2265
    }
2266
}
2267

2268
impl Shr<i32> for &USizeVec4 {
2269
    type Output = USizeVec4;
2270
    #[inline]
2271
    fn shr(self, rhs: i32) -> USizeVec4 {
3✔
2272
        (*self).shr(rhs)
3✔
2273
    }
2274
}
2275

2276
impl ShrAssign<i32> for USizeVec4 {
2277
    #[inline]
2278
    fn shr_assign(&mut self, rhs: i32) {
3✔
2279
        *self = self.shr(rhs);
3✔
2280
    }
2281
}
2282

2283
impl ShrAssign<&i32> for USizeVec4 {
2284
    #[inline]
2285
    fn shr_assign(&mut self, rhs: &i32) {
3✔
2286
        self.shr_assign(*rhs);
3✔
2287
    }
2288
}
2289

2290
impl Shl<i64> for USizeVec4 {
2291
    type Output = Self;
2292
    #[inline]
2293
    fn shl(self, rhs: i64) -> Self::Output {
3✔
2294
        Self {
2295
            x: self.x.shl(rhs),
3✔
2296
            y: self.y.shl(rhs),
3✔
2297
            z: self.z.shl(rhs),
3✔
2298
            w: self.w.shl(rhs),
3✔
2299
        }
2300
    }
2301
}
2302

2303
impl Shl<&i64> for USizeVec4 {
2304
    type Output = Self;
2305
    #[inline]
2306
    fn shl(self, rhs: &i64) -> Self {
3✔
2307
        self.shl(*rhs)
3✔
2308
    }
2309
}
2310

2311
impl Shl<&i64> for &USizeVec4 {
2312
    type Output = USizeVec4;
2313
    #[inline]
2314
    fn shl(self, rhs: &i64) -> USizeVec4 {
3✔
2315
        (*self).shl(*rhs)
3✔
2316
    }
2317
}
2318

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

2327
impl ShlAssign<i64> for USizeVec4 {
2328
    #[inline]
2329
    fn shl_assign(&mut self, rhs: i64) {
3✔
2330
        *self = self.shl(rhs);
3✔
2331
    }
2332
}
2333

2334
impl ShlAssign<&i64> for USizeVec4 {
2335
    #[inline]
2336
    fn shl_assign(&mut self, rhs: &i64) {
3✔
2337
        self.shl_assign(*rhs);
3✔
2338
    }
2339
}
2340

2341
impl Shr<i64> for USizeVec4 {
2342
    type Output = Self;
2343
    #[inline]
2344
    fn shr(self, rhs: i64) -> Self::Output {
3✔
2345
        Self {
2346
            x: self.x.shr(rhs),
3✔
2347
            y: self.y.shr(rhs),
3✔
2348
            z: self.z.shr(rhs),
3✔
2349
            w: self.w.shr(rhs),
3✔
2350
        }
2351
    }
2352
}
2353

2354
impl Shr<&i64> for USizeVec4 {
2355
    type Output = Self;
2356
    #[inline]
2357
    fn shr(self, rhs: &i64) -> Self {
3✔
2358
        self.shr(*rhs)
3✔
2359
    }
2360
}
2361

2362
impl Shr<&i64> for &USizeVec4 {
2363
    type Output = USizeVec4;
2364
    #[inline]
2365
    fn shr(self, rhs: &i64) -> USizeVec4 {
3✔
2366
        (*self).shr(*rhs)
3✔
2367
    }
2368
}
2369

2370
impl Shr<i64> for &USizeVec4 {
2371
    type Output = USizeVec4;
2372
    #[inline]
2373
    fn shr(self, rhs: i64) -> USizeVec4 {
3✔
2374
        (*self).shr(rhs)
3✔
2375
    }
2376
}
2377

2378
impl ShrAssign<i64> for USizeVec4 {
2379
    #[inline]
2380
    fn shr_assign(&mut self, rhs: i64) {
3✔
2381
        *self = self.shr(rhs);
3✔
2382
    }
2383
}
2384

2385
impl ShrAssign<&i64> for USizeVec4 {
2386
    #[inline]
2387
    fn shr_assign(&mut self, rhs: &i64) {
3✔
2388
        self.shr_assign(*rhs);
3✔
2389
    }
2390
}
2391

2392
impl Shl<u8> for USizeVec4 {
2393
    type Output = Self;
2394
    #[inline]
2395
    fn shl(self, rhs: u8) -> Self::Output {
3✔
2396
        Self {
2397
            x: self.x.shl(rhs),
3✔
2398
            y: self.y.shl(rhs),
3✔
2399
            z: self.z.shl(rhs),
3✔
2400
            w: self.w.shl(rhs),
3✔
2401
        }
2402
    }
2403
}
2404

2405
impl Shl<&u8> for USizeVec4 {
2406
    type Output = Self;
2407
    #[inline]
2408
    fn shl(self, rhs: &u8) -> Self {
3✔
2409
        self.shl(*rhs)
3✔
2410
    }
2411
}
2412

2413
impl Shl<&u8> for &USizeVec4 {
2414
    type Output = USizeVec4;
2415
    #[inline]
2416
    fn shl(self, rhs: &u8) -> USizeVec4 {
3✔
2417
        (*self).shl(*rhs)
3✔
2418
    }
2419
}
2420

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

2429
impl ShlAssign<u8> for USizeVec4 {
2430
    #[inline]
2431
    fn shl_assign(&mut self, rhs: u8) {
3✔
2432
        *self = self.shl(rhs);
3✔
2433
    }
2434
}
2435

2436
impl ShlAssign<&u8> for USizeVec4 {
2437
    #[inline]
2438
    fn shl_assign(&mut self, rhs: &u8) {
3✔
2439
        self.shl_assign(*rhs);
3✔
2440
    }
2441
}
2442

2443
impl Shr<u8> for USizeVec4 {
2444
    type Output = Self;
2445
    #[inline]
2446
    fn shr(self, rhs: u8) -> Self::Output {
3✔
2447
        Self {
2448
            x: self.x.shr(rhs),
3✔
2449
            y: self.y.shr(rhs),
3✔
2450
            z: self.z.shr(rhs),
3✔
2451
            w: self.w.shr(rhs),
3✔
2452
        }
2453
    }
2454
}
2455

2456
impl Shr<&u8> for USizeVec4 {
2457
    type Output = Self;
2458
    #[inline]
2459
    fn shr(self, rhs: &u8) -> Self {
3✔
2460
        self.shr(*rhs)
3✔
2461
    }
2462
}
2463

2464
impl Shr<&u8> for &USizeVec4 {
2465
    type Output = USizeVec4;
2466
    #[inline]
2467
    fn shr(self, rhs: &u8) -> USizeVec4 {
3✔
2468
        (*self).shr(*rhs)
3✔
2469
    }
2470
}
2471

2472
impl Shr<u8> for &USizeVec4 {
2473
    type Output = USizeVec4;
2474
    #[inline]
2475
    fn shr(self, rhs: u8) -> USizeVec4 {
3✔
2476
        (*self).shr(rhs)
3✔
2477
    }
2478
}
2479

2480
impl ShrAssign<u8> for USizeVec4 {
2481
    #[inline]
2482
    fn shr_assign(&mut self, rhs: u8) {
3✔
2483
        *self = self.shr(rhs);
3✔
2484
    }
2485
}
2486

2487
impl ShrAssign<&u8> for USizeVec4 {
2488
    #[inline]
2489
    fn shr_assign(&mut self, rhs: &u8) {
3✔
2490
        self.shr_assign(*rhs);
3✔
2491
    }
2492
}
2493

2494
impl Shl<u16> for USizeVec4 {
2495
    type Output = Self;
2496
    #[inline]
2497
    fn shl(self, rhs: u16) -> Self::Output {
3✔
2498
        Self {
2499
            x: self.x.shl(rhs),
3✔
2500
            y: self.y.shl(rhs),
3✔
2501
            z: self.z.shl(rhs),
3✔
2502
            w: self.w.shl(rhs),
3✔
2503
        }
2504
    }
2505
}
2506

2507
impl Shl<&u16> for USizeVec4 {
2508
    type Output = Self;
2509
    #[inline]
2510
    fn shl(self, rhs: &u16) -> Self {
3✔
2511
        self.shl(*rhs)
3✔
2512
    }
2513
}
2514

2515
impl Shl<&u16> for &USizeVec4 {
2516
    type Output = USizeVec4;
2517
    #[inline]
2518
    fn shl(self, rhs: &u16) -> USizeVec4 {
3✔
2519
        (*self).shl(*rhs)
3✔
2520
    }
2521
}
2522

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

2531
impl ShlAssign<u16> for USizeVec4 {
2532
    #[inline]
2533
    fn shl_assign(&mut self, rhs: u16) {
3✔
2534
        *self = self.shl(rhs);
3✔
2535
    }
2536
}
2537

2538
impl ShlAssign<&u16> for USizeVec4 {
2539
    #[inline]
2540
    fn shl_assign(&mut self, rhs: &u16) {
3✔
2541
        self.shl_assign(*rhs);
3✔
2542
    }
2543
}
2544

2545
impl Shr<u16> for USizeVec4 {
2546
    type Output = Self;
2547
    #[inline]
2548
    fn shr(self, rhs: u16) -> Self::Output {
3✔
2549
        Self {
2550
            x: self.x.shr(rhs),
3✔
2551
            y: self.y.shr(rhs),
3✔
2552
            z: self.z.shr(rhs),
3✔
2553
            w: self.w.shr(rhs),
3✔
2554
        }
2555
    }
2556
}
2557

2558
impl Shr<&u16> for USizeVec4 {
2559
    type Output = Self;
2560
    #[inline]
2561
    fn shr(self, rhs: &u16) -> Self {
3✔
2562
        self.shr(*rhs)
3✔
2563
    }
2564
}
2565

2566
impl Shr<&u16> for &USizeVec4 {
2567
    type Output = USizeVec4;
2568
    #[inline]
2569
    fn shr(self, rhs: &u16) -> USizeVec4 {
3✔
2570
        (*self).shr(*rhs)
3✔
2571
    }
2572
}
2573

2574
impl Shr<u16> for &USizeVec4 {
2575
    type Output = USizeVec4;
2576
    #[inline]
2577
    fn shr(self, rhs: u16) -> USizeVec4 {
3✔
2578
        (*self).shr(rhs)
3✔
2579
    }
2580
}
2581

2582
impl ShrAssign<u16> for USizeVec4 {
2583
    #[inline]
2584
    fn shr_assign(&mut self, rhs: u16) {
3✔
2585
        *self = self.shr(rhs);
3✔
2586
    }
2587
}
2588

2589
impl ShrAssign<&u16> for USizeVec4 {
2590
    #[inline]
2591
    fn shr_assign(&mut self, rhs: &u16) {
3✔
2592
        self.shr_assign(*rhs);
3✔
2593
    }
2594
}
2595

2596
impl Shl<u32> for USizeVec4 {
2597
    type Output = Self;
2598
    #[inline]
2599
    fn shl(self, rhs: u32) -> Self::Output {
3✔
2600
        Self {
2601
            x: self.x.shl(rhs),
3✔
2602
            y: self.y.shl(rhs),
3✔
2603
            z: self.z.shl(rhs),
3✔
2604
            w: self.w.shl(rhs),
3✔
2605
        }
2606
    }
2607
}
2608

2609
impl Shl<&u32> for USizeVec4 {
2610
    type Output = Self;
2611
    #[inline]
2612
    fn shl(self, rhs: &u32) -> Self {
3✔
2613
        self.shl(*rhs)
3✔
2614
    }
2615
}
2616

2617
impl Shl<&u32> for &USizeVec4 {
2618
    type Output = USizeVec4;
2619
    #[inline]
2620
    fn shl(self, rhs: &u32) -> USizeVec4 {
3✔
2621
        (*self).shl(*rhs)
3✔
2622
    }
2623
}
2624

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

2633
impl ShlAssign<u32> for USizeVec4 {
2634
    #[inline]
2635
    fn shl_assign(&mut self, rhs: u32) {
3✔
2636
        *self = self.shl(rhs);
3✔
2637
    }
2638
}
2639

2640
impl ShlAssign<&u32> for USizeVec4 {
2641
    #[inline]
2642
    fn shl_assign(&mut self, rhs: &u32) {
3✔
2643
        self.shl_assign(*rhs);
3✔
2644
    }
2645
}
2646

2647
impl Shr<u32> for USizeVec4 {
2648
    type Output = Self;
2649
    #[inline]
2650
    fn shr(self, rhs: u32) -> Self::Output {
3✔
2651
        Self {
2652
            x: self.x.shr(rhs),
3✔
2653
            y: self.y.shr(rhs),
3✔
2654
            z: self.z.shr(rhs),
3✔
2655
            w: self.w.shr(rhs),
3✔
2656
        }
2657
    }
2658
}
2659

2660
impl Shr<&u32> for USizeVec4 {
2661
    type Output = Self;
2662
    #[inline]
2663
    fn shr(self, rhs: &u32) -> Self {
3✔
2664
        self.shr(*rhs)
3✔
2665
    }
2666
}
2667

2668
impl Shr<&u32> for &USizeVec4 {
2669
    type Output = USizeVec4;
2670
    #[inline]
2671
    fn shr(self, rhs: &u32) -> USizeVec4 {
3✔
2672
        (*self).shr(*rhs)
3✔
2673
    }
2674
}
2675

2676
impl Shr<u32> for &USizeVec4 {
2677
    type Output = USizeVec4;
2678
    #[inline]
2679
    fn shr(self, rhs: u32) -> USizeVec4 {
3✔
2680
        (*self).shr(rhs)
3✔
2681
    }
2682
}
2683

2684
impl ShrAssign<u32> for USizeVec4 {
2685
    #[inline]
2686
    fn shr_assign(&mut self, rhs: u32) {
3✔
2687
        *self = self.shr(rhs);
3✔
2688
    }
2689
}
2690

2691
impl ShrAssign<&u32> for USizeVec4 {
2692
    #[inline]
2693
    fn shr_assign(&mut self, rhs: &u32) {
3✔
2694
        self.shr_assign(*rhs);
3✔
2695
    }
2696
}
2697

2698
impl Shl<u64> for USizeVec4 {
2699
    type Output = Self;
2700
    #[inline]
2701
    fn shl(self, rhs: u64) -> Self::Output {
3✔
2702
        Self {
2703
            x: self.x.shl(rhs),
3✔
2704
            y: self.y.shl(rhs),
3✔
2705
            z: self.z.shl(rhs),
3✔
2706
            w: self.w.shl(rhs),
3✔
2707
        }
2708
    }
2709
}
2710

2711
impl Shl<&u64> for USizeVec4 {
2712
    type Output = Self;
2713
    #[inline]
2714
    fn shl(self, rhs: &u64) -> Self {
3✔
2715
        self.shl(*rhs)
3✔
2716
    }
2717
}
2718

2719
impl Shl<&u64> for &USizeVec4 {
2720
    type Output = USizeVec4;
2721
    #[inline]
2722
    fn shl(self, rhs: &u64) -> USizeVec4 {
3✔
2723
        (*self).shl(*rhs)
3✔
2724
    }
2725
}
2726

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

2735
impl ShlAssign<u64> for USizeVec4 {
2736
    #[inline]
2737
    fn shl_assign(&mut self, rhs: u64) {
3✔
2738
        *self = self.shl(rhs);
3✔
2739
    }
2740
}
2741

2742
impl ShlAssign<&u64> for USizeVec4 {
2743
    #[inline]
2744
    fn shl_assign(&mut self, rhs: &u64) {
3✔
2745
        self.shl_assign(*rhs);
3✔
2746
    }
2747
}
2748

2749
impl Shr<u64> for USizeVec4 {
2750
    type Output = Self;
2751
    #[inline]
2752
    fn shr(self, rhs: u64) -> Self::Output {
3✔
2753
        Self {
2754
            x: self.x.shr(rhs),
3✔
2755
            y: self.y.shr(rhs),
3✔
2756
            z: self.z.shr(rhs),
3✔
2757
            w: self.w.shr(rhs),
3✔
2758
        }
2759
    }
2760
}
2761

2762
impl Shr<&u64> for USizeVec4 {
2763
    type Output = Self;
2764
    #[inline]
2765
    fn shr(self, rhs: &u64) -> Self {
3✔
2766
        self.shr(*rhs)
3✔
2767
    }
2768
}
2769

2770
impl Shr<&u64> for &USizeVec4 {
2771
    type Output = USizeVec4;
2772
    #[inline]
2773
    fn shr(self, rhs: &u64) -> USizeVec4 {
3✔
2774
        (*self).shr(*rhs)
3✔
2775
    }
2776
}
2777

2778
impl Shr<u64> for &USizeVec4 {
2779
    type Output = USizeVec4;
2780
    #[inline]
2781
    fn shr(self, rhs: u64) -> USizeVec4 {
3✔
2782
        (*self).shr(rhs)
3✔
2783
    }
2784
}
2785

2786
impl ShrAssign<u64> for USizeVec4 {
2787
    #[inline]
2788
    fn shr_assign(&mut self, rhs: u64) {
3✔
2789
        *self = self.shr(rhs);
3✔
2790
    }
2791
}
2792

2793
impl ShrAssign<&u64> for USizeVec4 {
2794
    #[inline]
2795
    fn shr_assign(&mut self, rhs: &u64) {
3✔
2796
        self.shr_assign(*rhs);
3✔
2797
    }
2798
}
2799

2800
#[cfg(feature = "i32")]
2801

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

2815
#[cfg(feature = "i32")]
2816

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

2825
#[cfg(feature = "i32")]
2826

2827
impl Shl<&IVec4> for &USizeVec4 {
2828
    type Output = USizeVec4;
2829
    #[inline]
2830
    fn shl(self, rhs: &IVec4) -> USizeVec4 {
3✔
2831
        (*self).shl(*rhs)
3✔
2832
    }
2833
}
2834

2835
#[cfg(feature = "i32")]
2836

2837
impl Shl<IVec4> for &USizeVec4 {
2838
    type Output = USizeVec4;
2839
    #[inline]
2840
    fn shl(self, rhs: IVec4) -> USizeVec4 {
3✔
2841
        (*self).shl(rhs)
3✔
2842
    }
2843
}
2844

2845
#[cfg(feature = "i32")]
2846

2847
impl Shr<IVec4> for USizeVec4 {
2848
    type Output = Self;
2849
    #[inline]
2850
    fn shr(self, rhs: IVec4) -> Self {
3✔
2851
        Self {
2852
            x: self.x.shr(rhs.x),
3✔
2853
            y: self.y.shr(rhs.y),
3✔
2854
            z: self.z.shr(rhs.z),
3✔
2855
            w: self.w.shr(rhs.w),
3✔
2856
        }
2857
    }
2858
}
2859

2860
#[cfg(feature = "i32")]
2861

2862
impl Shr<&IVec4> for USizeVec4 {
2863
    type Output = Self;
2864
    #[inline]
2865
    fn shr(self, rhs: &IVec4) -> Self {
3✔
2866
        self.shr(*rhs)
3✔
2867
    }
2868
}
2869

2870
#[cfg(feature = "i32")]
2871

2872
impl Shr<&IVec4> for &USizeVec4 {
2873
    type Output = USizeVec4;
2874
    #[inline]
2875
    fn shr(self, rhs: &IVec4) -> USizeVec4 {
3✔
2876
        (*self).shr(*rhs)
3✔
2877
    }
2878
}
2879

2880
#[cfg(feature = "i32")]
2881

2882
impl Shr<IVec4> for &USizeVec4 {
2883
    type Output = USizeVec4;
2884
    #[inline]
2885
    fn shr(self, rhs: IVec4) -> USizeVec4 {
3✔
2886
        (*self).shr(rhs)
3✔
2887
    }
2888
}
2889

2890
#[cfg(feature = "u32")]
2891

2892
impl Shl<UVec4> for USizeVec4 {
2893
    type Output = Self;
2894
    #[inline]
2895
    fn shl(self, rhs: UVec4) -> Self {
3✔
2896
        Self {
2897
            x: self.x.shl(rhs.x),
3✔
2898
            y: self.y.shl(rhs.y),
3✔
2899
            z: self.z.shl(rhs.z),
3✔
2900
            w: self.w.shl(rhs.w),
3✔
2901
        }
2902
    }
2903
}
2904

2905
#[cfg(feature = "u32")]
2906

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

2915
#[cfg(feature = "u32")]
2916

2917
impl Shl<&UVec4> for &USizeVec4 {
2918
    type Output = USizeVec4;
2919
    #[inline]
2920
    fn shl(self, rhs: &UVec4) -> USizeVec4 {
3✔
2921
        (*self).shl(*rhs)
3✔
2922
    }
2923
}
2924

2925
#[cfg(feature = "u32")]
2926

2927
impl Shl<UVec4> for &USizeVec4 {
2928
    type Output = USizeVec4;
2929
    #[inline]
2930
    fn shl(self, rhs: UVec4) -> USizeVec4 {
3✔
2931
        (*self).shl(rhs)
3✔
2932
    }
2933
}
2934

2935
#[cfg(feature = "u32")]
2936

2937
impl Shr<UVec4> for USizeVec4 {
2938
    type Output = Self;
2939
    #[inline]
2940
    fn shr(self, rhs: UVec4) -> Self {
3✔
2941
        Self {
2942
            x: self.x.shr(rhs.x),
3✔
2943
            y: self.y.shr(rhs.y),
3✔
2944
            z: self.z.shr(rhs.z),
3✔
2945
            w: self.w.shr(rhs.w),
3✔
2946
        }
2947
    }
2948
}
2949

2950
#[cfg(feature = "u32")]
2951

2952
impl Shr<&UVec4> for USizeVec4 {
2953
    type Output = Self;
2954
    #[inline]
2955
    fn shr(self, rhs: &UVec4) -> Self {
3✔
2956
        self.shr(*rhs)
3✔
2957
    }
2958
}
2959

2960
#[cfg(feature = "u32")]
2961

2962
impl Shr<&UVec4> for &USizeVec4 {
2963
    type Output = USizeVec4;
2964
    #[inline]
2965
    fn shr(self, rhs: &UVec4) -> USizeVec4 {
3✔
2966
        (*self).shr(*rhs)
3✔
2967
    }
2968
}
2969

2970
#[cfg(feature = "u32")]
2971

2972
impl Shr<UVec4> for &USizeVec4 {
2973
    type Output = USizeVec4;
2974
    #[inline]
2975
    fn shr(self, rhs: UVec4) -> USizeVec4 {
3✔
2976
        (*self).shr(rhs)
3✔
2977
    }
2978
}
2979

2980
impl Index<usize> for USizeVec4 {
2981
    type Output = usize;
2982
    #[inline]
2983
    fn index(&self, index: usize) -> &Self::Output {
3✔
2984
        match index {
6✔
2985
            0 => &self.x,
3✔
2986
            1 => &self.y,
3✔
2987
            2 => &self.z,
3✔
2988
            3 => &self.w,
3✔
2989
            _ => panic!("index out of bounds"),
×
2990
        }
2991
    }
2992
}
2993

2994
impl IndexMut<usize> for USizeVec4 {
2995
    #[inline]
2996
    fn index_mut(&mut self, index: usize) -> &mut Self::Output {
3✔
2997
        match index {
6✔
2998
            0 => &mut self.x,
3✔
2999
            1 => &mut self.y,
3✔
3000
            2 => &mut self.z,
3✔
3001
            3 => &mut self.w,
3✔
3002
            _ => panic!("index out of bounds"),
×
3003
        }
3004
    }
3005
}
3006

3007
impl fmt::Display for USizeVec4 {
3008
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3✔
3009
        write!(f, "[{}, {}, {}, {}]", self.x, self.y, self.z, self.w)
3✔
3010
    }
3011
}
3012

3013
impl fmt::Debug for USizeVec4 {
3014
    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
3✔
3015
        fmt.debug_tuple(stringify!(USizeVec4))
3✔
3016
            .field(&self.x)
3✔
3017
            .field(&self.y)
3✔
3018
            .field(&self.z)
3✔
3019
            .field(&self.w)
3✔
3020
            .finish()
3021
    }
3022
}
3023

3024
impl From<[usize; 4]> for USizeVec4 {
3025
    #[inline]
3026
    fn from(a: [usize; 4]) -> Self {
3✔
3027
        Self::new(a[0], a[1], a[2], a[3])
3✔
3028
    }
3029
}
3030

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

3038
impl From<(usize, usize, usize, usize)> for USizeVec4 {
3039
    #[inline]
3040
    fn from(t: (usize, usize, usize, usize)) -> Self {
3✔
3041
        Self::new(t.0, t.1, t.2, t.3)
3✔
3042
    }
3043
}
3044

3045
impl From<USizeVec4> for (usize, usize, usize, usize) {
3046
    #[inline]
3047
    fn from(v: USizeVec4) -> Self {
6✔
3048
        (v.x, v.y, v.z, v.w)
6✔
3049
    }
3050
}
3051

3052
impl From<(USizeVec3, usize)> for USizeVec4 {
3053
    #[inline]
3054
    fn from((v, w): (USizeVec3, usize)) -> Self {
6✔
3055
        Self::new(v.x, v.y, v.z, w)
3✔
3056
    }
3057
}
3058

3059
impl From<(usize, USizeVec3)> for USizeVec4 {
3060
    #[inline]
3061
    fn from((x, v): (usize, USizeVec3)) -> Self {
6✔
3062
        Self::new(x, v.x, v.y, v.z)
3✔
3063
    }
3064
}
3065

3066
impl From<(USizeVec2, usize, usize)> for USizeVec4 {
3067
    #[inline]
3068
    fn from((v, z, w): (USizeVec2, usize, usize)) -> Self {
6✔
3069
        Self::new(v.x, v.y, z, w)
×
3070
    }
3071
}
3072

3073
impl From<(USizeVec2, USizeVec2)> for USizeVec4 {
3074
    #[inline]
3075
    fn from((v, u): (USizeVec2, USizeVec2)) -> Self {
6✔
3076
        Self::new(v.x, v.y, u.x, u.y)
×
3077
    }
3078
}
3079

3080
impl From<U8Vec4> for USizeVec4 {
3081
    #[inline]
3082
    fn from(v: U8Vec4) -> Self {
3✔
3083
        Self::new(
3084
            usize::from(v.x),
3✔
3085
            usize::from(v.y),
3✔
3086
            usize::from(v.z),
3✔
3087
            usize::from(v.w),
3✔
3088
        )
3089
    }
3090
}
3091

3092
impl From<U16Vec4> for USizeVec4 {
3093
    #[inline]
3094
    fn from(v: U16Vec4) -> Self {
3✔
3095
        Self::new(
3096
            usize::from(v.x),
3✔
3097
            usize::from(v.y),
3✔
3098
            usize::from(v.z),
3✔
3099
            usize::from(v.w),
3✔
3100
        )
3101
    }
3102
}
3103

3104
#[cfg(feature = "i8")]
3105

3106
impl TryFrom<I8Vec4> for USizeVec4 {
3107
    type Error = core::num::TryFromIntError;
3108

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

3120
#[cfg(feature = "i16")]
3121

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

3125
    #[inline]
3126
    fn try_from(v: I16Vec4) -> 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
#[cfg(feature = "i32")]
3137

3138
impl TryFrom<IVec4> for USizeVec4 {
3139
    type Error = core::num::TryFromIntError;
3140

3141
    #[inline]
3142
    fn try_from(v: IVec4) -> Result<Self, Self::Error> {
3✔
3143
        Ok(Self::new(
3✔
3144
            usize::try_from(v.x)?,
3✔
3145
            usize::try_from(v.y)?,
3✔
3146
            usize::try_from(v.z)?,
3✔
3147
            usize::try_from(v.w)?,
3✔
3148
        ))
3149
    }
3150
}
3151

3152
#[cfg(feature = "i64")]
3153

3154
impl TryFrom<I64Vec4> for USizeVec4 {
3155
    type Error = core::num::TryFromIntError;
3156

3157
    #[inline]
3158
    fn try_from(v: I64Vec4) -> Result<Self, Self::Error> {
3✔
3159
        Ok(Self::new(
3✔
3160
            usize::try_from(v.x)?,
3✔
3161
            usize::try_from(v.y)?,
3✔
3162
            usize::try_from(v.z)?,
3✔
3163
            usize::try_from(v.w)?,
3✔
3164
        ))
3165
    }
3166
}
3167

3168
#[cfg(feature = "u32")]
3169

3170
impl TryFrom<UVec4> for USizeVec4 {
3171
    type Error = core::num::TryFromIntError;
3172

3173
    #[inline]
3174
    fn try_from(v: UVec4) -> Result<Self, Self::Error> {
3✔
3175
        Ok(Self::new(
3✔
3176
            usize::try_from(v.x)?,
3✔
3177
            usize::try_from(v.y)?,
3✔
3178
            usize::try_from(v.z)?,
3✔
3179
            usize::try_from(v.w)?,
3✔
3180
        ))
3181
    }
3182
}
3183

3184
#[cfg(feature = "u64")]
3185

3186
impl TryFrom<U64Vec4> for USizeVec4 {
3187
    type Error = core::num::TryFromIntError;
3188

3189
    #[inline]
3190
    fn try_from(v: U64Vec4) -> Result<Self, Self::Error> {
3✔
3191
        Ok(Self::new(
3✔
3192
            usize::try_from(v.x)?,
3✔
3193
            usize::try_from(v.y)?,
3✔
3194
            usize::try_from(v.z)?,
3✔
3195
            usize::try_from(v.w)?,
3✔
3196
        ))
3197
    }
3198
}
3199

3200
#[cfg(feature = "isize")]
3201

3202
impl TryFrom<ISizeVec4> for USizeVec4 {
3203
    type Error = core::num::TryFromIntError;
3204

3205
    #[inline]
3206
    fn try_from(v: ISizeVec4) -> Result<Self, Self::Error> {
3✔
3207
        Ok(Self::new(
3✔
3208
            usize::try_from(v.x)?,
3✔
3209
            usize::try_from(v.y)?,
3✔
3210
            usize::try_from(v.z)?,
3✔
3211
            usize::try_from(v.w)?,
3✔
3212
        ))
3213
    }
3214
}
3215

3216
impl From<BVec4> for USizeVec4 {
3217
    #[inline]
3218
    fn from(v: BVec4) -> Self {
3✔
3219
        Self::new(
3220
            usize::from(v.x),
3✔
3221
            usize::from(v.y),
3✔
3222
            usize::from(v.z),
3✔
3223
            usize::from(v.w),
3✔
3224
        )
3225
    }
3226
}
3227

3228
#[cfg(not(feature = "scalar-math"))]
3229
impl From<BVec4A> for USizeVec4 {
3230
    #[inline]
3231
    fn from(v: BVec4A) -> Self {
2✔
3232
        let bool_array: [bool; 4] = v.into();
2✔
3233
        Self::new(
3234
            usize::from(bool_array[0]),
2✔
3235
            usize::from(bool_array[1]),
2✔
3236
            usize::from(bool_array[2]),
2✔
3237
            usize::from(bool_array[3]),
2✔
3238
        )
3239
    }
3240
}
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