• 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

97.97
/src/u8/u8vec3.rs
1
// Generated from vec.rs.tera template. Edit the template, not the generated file.
2

3
use crate::{BVec3, BVec3A, U8Vec2, U8Vec4};
4

5
#[cfg(feature = "i8")]
6
use crate::I8Vec3;
7

8
#[cfg(feature = "i16")]
9
use crate::I16Vec3;
10

11
#[cfg(feature = "u16")]
12
use crate::U16Vec3;
13

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

17
#[cfg(feature = "u32")]
18
use crate::UVec3;
19

20
#[cfg(feature = "i64")]
21
use crate::I64Vec3;
22

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

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

29
#[cfg(feature = "usize")]
30
use crate::USizeVec3;
31

32
use core::fmt;
33
use core::iter::{Product, Sum};
34
use core::{f32, ops::*};
35

36
#[cfg(feature = "zerocopy")]
37
use zerocopy_derive::*;
38

39
/// Creates a 3-dimensional vector.
40
#[inline(always)]
41
#[must_use]
42
pub const fn u8vec3(x: u8, y: u8, z: u8) -> U8Vec3 {
6✔
43
    U8Vec3::new(x, y, z)
6✔
44
}
45

46
/// A 3-dimensional vector.
47
#[derive(Clone, Copy, PartialEq, Eq, Hash)]
48
#[cfg_attr(feature = "bytemuck", derive(bytemuck::Pod, bytemuck::Zeroable))]
49
#[cfg_attr(
50
    feature = "zerocopy",
51
    derive(FromBytes, Immutable, IntoBytes, KnownLayout)
52
)]
53
#[repr(C)]
54
#[cfg_attr(target_arch = "spirv", rust_gpu::vector::v1)]
55
pub struct U8Vec3 {
56
    pub x: u8,
57
    pub y: u8,
58
    pub z: u8,
59
}
60

61
impl U8Vec3 {
62
    /// All zeroes.
63
    pub const ZERO: Self = Self::splat(0);
64

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

68
    /// All `u8::MIN`.
69
    pub const MIN: Self = Self::splat(u8::MIN);
70

71
    /// All `u8::MAX`.
72
    pub const MAX: Self = Self::splat(u8::MAX);
73

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

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

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

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

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

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

100
    /// Returns a vector containing each element of `self` modified by a mapping function `f`.
101
    #[inline]
102
    #[must_use]
103
    pub fn map<F>(self, f: F) -> Self
6✔
104
    where
105
        F: Fn(u8) -> u8,
106
    {
107
        Self::new(f(self.x), f(self.y), f(self.z))
12✔
108
    }
109

110
    /// Creates a vector from the elements in `if_true` and `if_false`, selecting which to use
111
    /// for each element of `self`.
112
    ///
113
    /// A true element in the mask uses the corresponding element from `if_true`, and false
114
    /// uses the element from `if_false`.
115
    #[inline]
116
    #[must_use]
117
    pub fn select(mask: BVec3, if_true: Self, if_false: Self) -> Self {
3✔
118
        Self {
119
            x: if mask.test(0) { if_true.x } else { if_false.x },
3✔
120
            y: if mask.test(1) { if_true.y } else { if_false.y },
3✔
121
            z: if mask.test(2) { if_true.z } else { if_false.z },
3✔
122
        }
123
    }
124

125
    /// Creates a new vector from an array.
126
    #[inline]
127
    #[must_use]
128
    pub const fn from_array(a: [u8; 3]) -> Self {
×
129
        Self::new(a[0], a[1], a[2])
×
130
    }
131

132
    /// Converts `self` to `[x, y, z]`
133
    #[inline]
134
    #[must_use]
135
    pub const fn to_array(&self) -> [u8; 3] {
3✔
136
        [self.x, self.y, self.z]
3✔
137
    }
138

139
    /// Creates a vector from the first 3 values in `slice`.
140
    ///
141
    /// # Panics
142
    ///
143
    /// Panics if `slice` is less than 3 elements long.
144
    #[inline]
145
    #[must_use]
146
    pub const fn from_slice(slice: &[u8]) -> Self {
3✔
147
        assert!(slice.len() >= 3);
3✔
148
        Self::new(slice[0], slice[1], slice[2])
6✔
149
    }
150

151
    /// Writes the elements of `self` to the first 3 elements in `slice`.
152
    ///
153
    /// # Panics
154
    ///
155
    /// Panics if `slice` is less than 3 elements long.
156
    #[inline]
157
    pub fn write_to_slice(self, slice: &mut [u8]) {
3✔
158
        slice[..3].copy_from_slice(&self.to_array());
3✔
159
    }
160

161
    /// Internal method for creating a 3D vector from a 4D vector, discarding `w`.
162
    #[allow(dead_code)]
163
    #[inline]
164
    #[must_use]
165
    pub(crate) fn from_vec4(v: U8Vec4) -> Self {
×
166
        Self {
167
            x: v.x,
×
168
            y: v.y,
×
169
            z: v.z,
×
170
        }
171
    }
172

173
    /// Creates a 4D vector from `self` and the given `w` value.
174
    #[inline]
175
    #[must_use]
176
    pub fn extend(self, w: u8) -> U8Vec4 {
3✔
177
        U8Vec4::new(self.x, self.y, self.z, w)
3✔
178
    }
179

180
    /// Creates a 2D vector from the `x` and `y` elements of `self`, discarding `z`.
181
    ///
182
    /// Truncation may also be performed by using [`self.xy()`][crate::swizzles::Vec3Swizzles::xy()].
183
    #[inline]
184
    #[must_use]
185
    pub fn truncate(self) -> U8Vec2 {
×
186
        use crate::swizzles::Vec3Swizzles;
187
        self.xy()
×
188
    }
189

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

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

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

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

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

228
    /// Computes the cross product of `self` and `rhs`.
229
    #[inline]
230
    #[must_use]
231
    pub fn cross(self, rhs: Self) -> Self {
3✔
232
        Self {
233
            x: self.y * rhs.z - rhs.y * self.z,
3✔
234
            y: self.z * rhs.x - rhs.z * self.x,
6✔
235
            z: self.x * rhs.y - rhs.x * self.y,
6✔
236
        }
237
    }
238

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

252
    /// Returns a vector containing the maximum values for each element of `self` and `rhs`.
253
    ///
254
    /// In other words this computes `[max(self.x, rhs.x), max(self.y, rhs.y), ..]`.
255
    #[inline]
256
    #[must_use]
257
    pub fn max(self, rhs: Self) -> Self {
3✔
258
        Self {
259
            x: if self.x > rhs.x { self.x } else { rhs.x },
3✔
260
            y: if self.y > rhs.y { self.y } else { rhs.y },
3✔
261
            z: if self.z > rhs.z { self.z } else { rhs.z },
3✔
262
        }
263
    }
264

265
    /// Component-wise clamping of values, similar to [`u8::clamp`].
266
    ///
267
    /// Each element in `min` must be less-or-equal to the corresponding element in `max`.
268
    ///
269
    /// # Panics
270
    ///
271
    /// Will panic if `min` is greater than `max` when `glam_assert` is enabled.
272
    #[inline]
273
    #[must_use]
274
    pub fn clamp(self, min: Self, max: Self) -> Self {
3✔
275
        glam_assert!(min.cmple(max).all(), "clamp: expected min <= max");
3✔
276
        self.max(min).min(max)
3✔
277
    }
278

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

289
    /// Returns the horizontal maximum of `self`.
290
    ///
291
    /// In other words this computes `max(x, y, ..)`.
292
    #[inline]
293
    #[must_use]
294
    pub fn max_element(self) -> u8 {
6✔
295
        let max = |a, b| if a > b { a } else { b };
12✔
296
        max(self.x, max(self.y, self.z))
6✔
297
    }
298

299
    /// Returns the index of the first minimum element of `self`.
300
    #[doc(alias = "argmin")]
301
    #[inline]
302
    #[must_use]
303
    pub fn min_position(self) -> usize {
3✔
304
        let mut min = self.x;
3✔
305
        let mut index = 0;
3✔
306
        if self.y < min {
6✔
307
            min = self.y;
3✔
308
            index = 1;
3✔
309
        }
310
        if self.z < min {
6✔
311
            index = 2;
3✔
312
        }
313
        index
3✔
314
    }
315

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

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

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

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

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

373
    /// Returns a vector mask containing the result of a `>=` comparison for each element of
374
    /// `self` and `rhs`.
375
    ///
376
    /// In other words this computes `[self.x >= rhs.x, self.y >= rhs.y, ..]` for all
377
    /// elements.
378
    #[inline]
379
    #[must_use]
380
    pub fn cmpge(self, rhs: Self) -> BVec3 {
3✔
381
        BVec3::new(self.x.ge(&rhs.x), self.y.ge(&rhs.y), self.z.ge(&rhs.z))
3✔
382
    }
383

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

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

406
    /// Returns a vector mask containing the result of a `<` comparison for each element of
407
    /// `self` and `rhs`.
408
    ///
409
    /// In other words this computes `[self.x < rhs.x, self.y < rhs.y, ..]` for all
410
    /// elements.
411
    #[inline]
412
    #[must_use]
413
    pub fn cmplt(self, rhs: Self) -> BVec3 {
3✔
414
        BVec3::new(self.x.lt(&rhs.x), self.y.lt(&rhs.y), self.z.lt(&rhs.z))
3✔
415
    }
416

417
    /// Computes the squared length of `self`.
418
    #[doc(alias = "magnitude2")]
419
    #[inline]
420
    #[must_use]
421
    pub fn length_squared(self) -> u8 {
3✔
422
        self.dot(self)
3✔
423
    }
424

425
    /// Computes the [manhattan distance] between two points.
426
    ///
427
    /// # Overflow
428
    /// This method may overflow if the result is greater than [`u8::MAX`].
429
    ///
430
    /// See also [`checked_manhattan_distance`][U8Vec3::checked_manhattan_distance].
431
    ///
432
    /// [manhattan distance]: https://en.wikipedia.org/wiki/Taxicab_geometry
433
    #[inline]
434
    #[must_use]
435
    pub fn manhattan_distance(self, rhs: Self) -> u8 {
3✔
436
        self.x.abs_diff(rhs.x) + self.y.abs_diff(rhs.y) + self.z.abs_diff(rhs.z)
3✔
437
    }
438

439
    /// Computes the [manhattan distance] between two points.
440
    ///
441
    /// This will returns [`None`] if the result is greater than [`u8::MAX`].
442
    ///
443
    /// [manhattan distance]: https://en.wikipedia.org/wiki/Taxicab_geometry
444
    #[inline]
445
    #[must_use]
446
    pub fn checked_manhattan_distance(self, rhs: Self) -> Option<u8> {
3✔
447
        let d = self.x.abs_diff(rhs.x);
3✔
448
        let d = d.checked_add(self.y.abs_diff(rhs.y))?;
3✔
449
        d.checked_add(self.z.abs_diff(rhs.z))
3✔
450
    }
451

452
    /// Computes the [chebyshev distance] between two points.
453
    ///
454
    /// [chebyshev distance]: https://en.wikipedia.org/wiki/Chebyshev_distance
455
    #[inline]
456
    #[must_use]
457
    pub fn chebyshev_distance(self, rhs: Self) -> u8 {
3✔
458
        // Note: the compiler will eventually optimize out the loop
459
        [
460
            self.x.abs_diff(rhs.x),
3✔
461
            self.y.abs_diff(rhs.y),
3✔
462
            self.z.abs_diff(rhs.z),
3✔
463
        ]
464
        .into_iter()
465
        .max()
466
        .unwrap()
467
    }
468

469
    /// Casts all elements of `self` to `f32`.
470
    #[inline]
471
    #[must_use]
472
    pub fn as_vec3(self) -> crate::Vec3 {
3✔
473
        crate::Vec3::new(self.x as f32, self.y as f32, self.z as f32)
3✔
474
    }
475

476
    /// Casts all elements of `self` to `f32`.
477
    #[inline]
478
    #[must_use]
479
    pub fn as_vec3a(self) -> crate::Vec3A {
3✔
480
        crate::Vec3A::new(self.x as f32, self.y as f32, self.z as f32)
3✔
481
    }
482

483
    /// Casts all elements of `self` to `f64`.
484
    #[cfg(feature = "f64")]
485
    #[inline]
486
    #[must_use]
487
    pub fn as_dvec3(self) -> crate::DVec3 {
3✔
488
        crate::DVec3::new(self.x as f64, self.y as f64, self.z as f64)
3✔
489
    }
490

491
    /// Casts all elements of `self` to `i8`.
492
    #[cfg(feature = "i8")]
493
    #[inline]
494
    #[must_use]
495
    pub fn as_i8vec3(self) -> crate::I8Vec3 {
3✔
496
        crate::I8Vec3::new(self.x as i8, self.y as i8, self.z as i8)
3✔
497
    }
498

499
    /// Casts all elements of `self` to `i16`.
500
    #[cfg(feature = "i16")]
501
    #[inline]
502
    #[must_use]
503
    pub fn as_i16vec3(self) -> crate::I16Vec3 {
3✔
504
        crate::I16Vec3::new(self.x as i16, self.y as i16, self.z as i16)
3✔
505
    }
506

507
    /// Casts all elements of `self` to `u16`.
508
    #[cfg(feature = "u16")]
509
    #[inline]
510
    #[must_use]
511
    pub fn as_u16vec3(self) -> crate::U16Vec3 {
3✔
512
        crate::U16Vec3::new(self.x as u16, self.y as u16, self.z as u16)
3✔
513
    }
514

515
    /// Casts all elements of `self` to `i32`.
516
    #[cfg(feature = "i32")]
517
    #[inline]
518
    #[must_use]
519
    pub fn as_ivec3(self) -> crate::IVec3 {
3✔
520
        crate::IVec3::new(self.x as i32, self.y as i32, self.z as i32)
3✔
521
    }
522

523
    /// Casts all elements of `self` to `u32`.
524
    #[cfg(feature = "u32")]
525
    #[inline]
526
    #[must_use]
527
    pub fn as_uvec3(self) -> crate::UVec3 {
3✔
528
        crate::UVec3::new(self.x as u32, self.y as u32, self.z as u32)
3✔
529
    }
530

531
    /// Casts all elements of `self` to `i64`.
532
    #[cfg(feature = "i64")]
533
    #[inline]
534
    #[must_use]
535
    pub fn as_i64vec3(self) -> crate::I64Vec3 {
3✔
536
        crate::I64Vec3::new(self.x as i64, self.y as i64, self.z as i64)
3✔
537
    }
538

539
    /// Casts all elements of `self` to `u64`.
540
    #[cfg(feature = "u64")]
541
    #[inline]
542
    #[must_use]
543
    pub fn as_u64vec3(self) -> crate::U64Vec3 {
3✔
544
        crate::U64Vec3::new(self.x as u64, self.y as u64, self.z as u64)
3✔
545
    }
546

547
    /// Casts all elements of `self` to `isize`.
548
    #[cfg(feature = "isize")]
549
    #[inline]
550
    #[must_use]
551
    pub fn as_isizevec3(self) -> crate::ISizeVec3 {
3✔
552
        crate::ISizeVec3::new(self.x as isize, self.y as isize, self.z as isize)
3✔
553
    }
554

555
    /// Casts all elements of `self` to `usize`.
556
    #[cfg(feature = "usize")]
557
    #[inline]
558
    #[must_use]
559
    pub fn as_usizevec3(self) -> crate::USizeVec3 {
3✔
560
        crate::USizeVec3::new(self.x as usize, self.y as usize, self.z as usize)
3✔
561
    }
562

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

582
        Some(Self { x, y, z })
3✔
583
    }
584

585
    /// Returns a vector containing the wrapping subtraction of `self` and `rhs`.
586
    ///
587
    /// In other words this computes `Some([self.x - rhs.x, self.y - rhs.y, ..])` but returns `None` on any overflow.
588
    #[inline]
589
    #[must_use]
590
    pub const fn checked_sub(self, rhs: Self) -> Option<Self> {
3✔
591
        let x = match self.x.checked_sub(rhs.x) {
3✔
592
            Some(v) => v,
3✔
593
            None => return None,
3✔
594
        };
595
        let y = match self.y.checked_sub(rhs.y) {
3✔
596
            Some(v) => v,
3✔
597
            None => return None,
3✔
598
        };
599
        let z = match self.z.checked_sub(rhs.z) {
3✔
600
            Some(v) => v,
3✔
601
            None => return None,
3✔
602
        };
603

604
        Some(Self { x, y, z })
3✔
605
    }
606

607
    /// Returns a vector containing the wrapping multiplication of `self` and `rhs`.
608
    ///
609
    /// In other words this computes `Some([self.x * rhs.x, self.y * rhs.y, ..])` but returns `None` on any overflow.
610
    #[inline]
611
    #[must_use]
612
    pub const fn checked_mul(self, rhs: Self) -> Option<Self> {
3✔
613
        let x = match self.x.checked_mul(rhs.x) {
3✔
614
            Some(v) => v,
3✔
615
            None => return None,
3✔
616
        };
617
        let y = match self.y.checked_mul(rhs.y) {
3✔
618
            Some(v) => v,
3✔
619
            None => return None,
×
620
        };
621
        let z = match self.z.checked_mul(rhs.z) {
3✔
622
            Some(v) => v,
3✔
623
            None => return None,
×
624
        };
625

626
        Some(Self { x, y, z })
3✔
627
    }
628

629
    /// Returns a vector containing the wrapping division of `self` and `rhs`.
630
    ///
631
    /// In other words this computes `Some([self.x / rhs.x, self.y / rhs.y, ..])` but returns `None` on any division by zero.
632
    #[inline]
633
    #[must_use]
634
    pub const fn checked_div(self, rhs: Self) -> Option<Self> {
3✔
635
        let x = match self.x.checked_div(rhs.x) {
3✔
636
            Some(v) => v,
3✔
637
            None => return None,
3✔
638
        };
639
        let y = match self.y.checked_div(rhs.y) {
3✔
640
            Some(v) => v,
3✔
641
            None => return None,
3✔
642
        };
643
        let z = match self.z.checked_div(rhs.z) {
3✔
644
            Some(v) => v,
3✔
645
            None => return None,
×
646
        };
647

648
        Some(Self { x, y, z })
3✔
649
    }
650

651
    /// Returns a vector containing the wrapping addition of `self` and `rhs`.
652
    ///
653
    /// In other words this computes `[self.x.wrapping_add(rhs.x), self.y.wrapping_add(rhs.y), ..]`.
654
    #[inline]
655
    #[must_use]
656
    pub const fn wrapping_add(self, rhs: Self) -> Self {
3✔
657
        Self {
658
            x: self.x.wrapping_add(rhs.x),
3✔
659
            y: self.y.wrapping_add(rhs.y),
3✔
660
            z: self.z.wrapping_add(rhs.z),
3✔
661
        }
662
    }
663

664
    /// Returns a vector containing the wrapping subtraction of `self` and `rhs`.
665
    ///
666
    /// In other words this computes `[self.x.wrapping_sub(rhs.x), self.y.wrapping_sub(rhs.y), ..]`.
667
    #[inline]
668
    #[must_use]
669
    pub const fn wrapping_sub(self, rhs: Self) -> Self {
3✔
670
        Self {
671
            x: self.x.wrapping_sub(rhs.x),
3✔
672
            y: self.y.wrapping_sub(rhs.y),
3✔
673
            z: self.z.wrapping_sub(rhs.z),
3✔
674
        }
675
    }
676

677
    /// Returns a vector containing the wrapping multiplication of `self` and `rhs`.
678
    ///
679
    /// In other words this computes `[self.x.wrapping_mul(rhs.x), self.y.wrapping_mul(rhs.y), ..]`.
680
    #[inline]
681
    #[must_use]
682
    pub const fn wrapping_mul(self, rhs: Self) -> Self {
3✔
683
        Self {
684
            x: self.x.wrapping_mul(rhs.x),
3✔
685
            y: self.y.wrapping_mul(rhs.y),
3✔
686
            z: self.z.wrapping_mul(rhs.z),
3✔
687
        }
688
    }
689

690
    /// Returns a vector containing the wrapping division of `self` and `rhs`.
691
    ///
692
    /// In other words this computes `[self.x.wrapping_div(rhs.x), self.y.wrapping_div(rhs.y), ..]`.
693
    #[inline]
694
    #[must_use]
695
    pub const fn wrapping_div(self, rhs: Self) -> Self {
3✔
696
        Self {
697
            x: self.x.wrapping_div(rhs.x),
3✔
698
            y: self.y.wrapping_div(rhs.y),
3✔
699
            z: self.z.wrapping_div(rhs.z),
3✔
700
        }
701
    }
702

703
    /// Returns a vector containing the saturating addition of `self` and `rhs`.
704
    ///
705
    /// In other words this computes `[self.x.saturating_add(rhs.x), self.y.saturating_add(rhs.y), ..]`.
706
    #[inline]
707
    #[must_use]
708
    pub const fn saturating_add(self, rhs: Self) -> Self {
3✔
709
        Self {
710
            x: self.x.saturating_add(rhs.x),
3✔
711
            y: self.y.saturating_add(rhs.y),
3✔
712
            z: self.z.saturating_add(rhs.z),
3✔
713
        }
714
    }
715

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

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

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

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

759
    #[cfg(feature = "i8")]
760
    #[inline]
761
    #[must_use]
762
    pub const fn checked_add_signed(self, rhs: I8Vec3) -> Option<Self> {
3✔
763
        let x = match self.x.checked_add_signed(rhs.x) {
3✔
764
            Some(v) => v,
3✔
765
            None => return None,
3✔
766
        };
767
        let y = match self.y.checked_add_signed(rhs.y) {
3✔
768
            Some(v) => v,
3✔
769
            None => return None,
×
770
        };
771
        let z = match self.z.checked_add_signed(rhs.z) {
3✔
772
            Some(v) => v,
3✔
773
            None => return None,
×
774
        };
775

776
        Some(Self { x, y, z })
3✔
777
    }
778

779
    /// Returns a vector containing the wrapping addition of `self` and signed vector `rhs`.
780
    ///
781
    /// In other words this computes `[self.x.wrapping_add_signed(rhs.x), self.y.wrapping_add_signed(rhs.y), ..]`.
782

783
    #[cfg(feature = "i8")]
784
    #[inline]
785
    #[must_use]
786
    pub const fn wrapping_add_signed(self, rhs: I8Vec3) -> Self {
3✔
787
        Self {
788
            x: self.x.wrapping_add_signed(rhs.x),
3✔
789
            y: self.y.wrapping_add_signed(rhs.y),
3✔
790
            z: self.z.wrapping_add_signed(rhs.z),
3✔
791
        }
792
    }
793

794
    /// Returns a vector containing the saturating addition of `self` and signed vector `rhs`.
795
    ///
796
    /// In other words this computes `[self.x.saturating_add_signed(rhs.x), self.y.saturating_add_signed(rhs.y), ..]`.
797

798
    #[cfg(feature = "i8")]
799
    #[inline]
800
    #[must_use]
801
    pub const fn saturating_add_signed(self, rhs: I8Vec3) -> Self {
3✔
802
        Self {
803
            x: self.x.saturating_add_signed(rhs.x),
3✔
804
            y: self.y.saturating_add_signed(rhs.y),
3✔
805
            z: self.z.saturating_add_signed(rhs.z),
3✔
806
        }
807
    }
808
}
809

810
impl Default for U8Vec3 {
811
    #[inline(always)]
812
    fn default() -> Self {
×
813
        Self::ZERO
6✔
814
    }
815
}
816

817
impl Div for U8Vec3 {
818
    type Output = Self;
819
    #[inline]
820
    fn div(self, rhs: Self) -> Self {
3✔
821
        Self {
822
            x: self.x.div(rhs.x),
3✔
823
            y: self.y.div(rhs.y),
3✔
824
            z: self.z.div(rhs.z),
3✔
825
        }
826
    }
827
}
828

829
impl Div<&Self> for U8Vec3 {
830
    type Output = Self;
831
    #[inline]
832
    fn div(self, rhs: &Self) -> Self {
3✔
833
        self.div(*rhs)
3✔
834
    }
835
}
836

837
impl Div<&U8Vec3> for &U8Vec3 {
838
    type Output = U8Vec3;
839
    #[inline]
840
    fn div(self, rhs: &U8Vec3) -> U8Vec3 {
3✔
841
        (*self).div(*rhs)
3✔
842
    }
843
}
844

845
impl Div<U8Vec3> for &U8Vec3 {
846
    type Output = U8Vec3;
847
    #[inline]
848
    fn div(self, rhs: U8Vec3) -> U8Vec3 {
3✔
849
        (*self).div(rhs)
3✔
850
    }
851
}
852

853
impl DivAssign for U8Vec3 {
854
    #[inline]
855
    fn div_assign(&mut self, rhs: Self) {
3✔
856
        self.x.div_assign(rhs.x);
3✔
857
        self.y.div_assign(rhs.y);
5✔
858
        self.z.div_assign(rhs.z);
5✔
859
    }
860
}
861

862
impl DivAssign<&Self> for U8Vec3 {
863
    #[inline]
864
    fn div_assign(&mut self, rhs: &Self) {
3✔
865
        self.div_assign(*rhs);
3✔
866
    }
867
}
868

869
impl Div<u8> for U8Vec3 {
870
    type Output = Self;
871
    #[inline]
872
    fn div(self, rhs: u8) -> Self {
6✔
873
        Self {
874
            x: self.x.div(rhs),
6✔
875
            y: self.y.div(rhs),
6✔
876
            z: self.z.div(rhs),
6✔
877
        }
878
    }
879
}
880

881
impl Div<&u8> for U8Vec3 {
882
    type Output = Self;
883
    #[inline]
884
    fn div(self, rhs: &u8) -> Self {
3✔
885
        self.div(*rhs)
3✔
886
    }
887
}
888

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

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

905
impl DivAssign<u8> for U8Vec3 {
906
    #[inline]
907
    fn div_assign(&mut self, rhs: u8) {
3✔
908
        self.x.div_assign(rhs);
3✔
909
        self.y.div_assign(rhs);
5✔
910
        self.z.div_assign(rhs);
5✔
911
    }
912
}
913

914
impl DivAssign<&u8> for U8Vec3 {
915
    #[inline]
916
    fn div_assign(&mut self, rhs: &u8) {
3✔
917
        self.div_assign(*rhs);
3✔
918
    }
919
}
920

921
impl Div<U8Vec3> for u8 {
922
    type Output = U8Vec3;
923
    #[inline]
924
    fn div(self, rhs: U8Vec3) -> U8Vec3 {
3✔
925
        U8Vec3 {
926
            x: self.div(rhs.x),
3✔
927
            y: self.div(rhs.y),
3✔
928
            z: self.div(rhs.z),
3✔
929
        }
930
    }
931
}
932

933
impl Div<&U8Vec3> for u8 {
934
    type Output = U8Vec3;
935
    #[inline]
936
    fn div(self, rhs: &U8Vec3) -> U8Vec3 {
3✔
937
        self.div(*rhs)
3✔
938
    }
939
}
940

941
impl Div<&U8Vec3> for &u8 {
942
    type Output = U8Vec3;
943
    #[inline]
944
    fn div(self, rhs: &U8Vec3) -> U8Vec3 {
3✔
945
        (*self).div(*rhs)
3✔
946
    }
947
}
948

949
impl Div<U8Vec3> for &u8 {
950
    type Output = U8Vec3;
951
    #[inline]
952
    fn div(self, rhs: U8Vec3) -> U8Vec3 {
3✔
953
        (*self).div(rhs)
3✔
954
    }
955
}
956

957
impl Mul for U8Vec3 {
958
    type Output = Self;
959
    #[inline]
960
    fn mul(self, rhs: Self) -> Self {
3✔
961
        Self {
962
            x: self.x.mul(rhs.x),
3✔
963
            y: self.y.mul(rhs.y),
3✔
964
            z: self.z.mul(rhs.z),
3✔
965
        }
966
    }
967
}
968

969
impl Mul<&Self> for U8Vec3 {
970
    type Output = Self;
971
    #[inline]
972
    fn mul(self, rhs: &Self) -> Self {
3✔
973
        self.mul(*rhs)
3✔
974
    }
975
}
976

977
impl Mul<&U8Vec3> for &U8Vec3 {
978
    type Output = U8Vec3;
979
    #[inline]
980
    fn mul(self, rhs: &U8Vec3) -> U8Vec3 {
3✔
981
        (*self).mul(*rhs)
3✔
982
    }
983
}
984

985
impl Mul<U8Vec3> for &U8Vec3 {
986
    type Output = U8Vec3;
987
    #[inline]
988
    fn mul(self, rhs: U8Vec3) -> U8Vec3 {
3✔
989
        (*self).mul(rhs)
3✔
990
    }
991
}
992

993
impl MulAssign for U8Vec3 {
994
    #[inline]
995
    fn mul_assign(&mut self, rhs: Self) {
3✔
996
        self.x.mul_assign(rhs.x);
3✔
997
        self.y.mul_assign(rhs.y);
5✔
998
        self.z.mul_assign(rhs.z);
5✔
999
    }
1000
}
1001

1002
impl MulAssign<&Self> for U8Vec3 {
1003
    #[inline]
1004
    fn mul_assign(&mut self, rhs: &Self) {
3✔
1005
        self.mul_assign(*rhs);
3✔
1006
    }
1007
}
1008

1009
impl Mul<u8> for U8Vec3 {
1010
    type Output = Self;
1011
    #[inline]
1012
    fn mul(self, rhs: u8) -> Self {
3✔
1013
        Self {
1014
            x: self.x.mul(rhs),
3✔
1015
            y: self.y.mul(rhs),
3✔
1016
            z: self.z.mul(rhs),
3✔
1017
        }
1018
    }
1019
}
1020

1021
impl Mul<&u8> for U8Vec3 {
1022
    type Output = Self;
1023
    #[inline]
1024
    fn mul(self, rhs: &u8) -> Self {
3✔
1025
        self.mul(*rhs)
3✔
1026
    }
1027
}
1028

1029
impl Mul<&u8> for &U8Vec3 {
1030
    type Output = U8Vec3;
1031
    #[inline]
1032
    fn mul(self, rhs: &u8) -> U8Vec3 {
3✔
1033
        (*self).mul(*rhs)
3✔
1034
    }
1035
}
1036

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

1045
impl MulAssign<u8> for U8Vec3 {
1046
    #[inline]
1047
    fn mul_assign(&mut self, rhs: u8) {
3✔
1048
        self.x.mul_assign(rhs);
3✔
1049
        self.y.mul_assign(rhs);
5✔
1050
        self.z.mul_assign(rhs);
5✔
1051
    }
1052
}
1053

1054
impl MulAssign<&u8> for U8Vec3 {
1055
    #[inline]
1056
    fn mul_assign(&mut self, rhs: &u8) {
3✔
1057
        self.mul_assign(*rhs);
3✔
1058
    }
1059
}
1060

1061
impl Mul<U8Vec3> for u8 {
1062
    type Output = U8Vec3;
1063
    #[inline]
1064
    fn mul(self, rhs: U8Vec3) -> U8Vec3 {
3✔
1065
        U8Vec3 {
1066
            x: self.mul(rhs.x),
3✔
1067
            y: self.mul(rhs.y),
3✔
1068
            z: self.mul(rhs.z),
3✔
1069
        }
1070
    }
1071
}
1072

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

1081
impl Mul<&U8Vec3> for &u8 {
1082
    type Output = U8Vec3;
1083
    #[inline]
1084
    fn mul(self, rhs: &U8Vec3) -> U8Vec3 {
3✔
1085
        (*self).mul(*rhs)
3✔
1086
    }
1087
}
1088

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

1097
impl Add for U8Vec3 {
1098
    type Output = Self;
1099
    #[inline]
1100
    fn add(self, rhs: Self) -> Self {
3✔
1101
        Self {
1102
            x: self.x.add(rhs.x),
3✔
1103
            y: self.y.add(rhs.y),
4✔
1104
            z: self.z.add(rhs.z),
4✔
1105
        }
1106
    }
1107
}
1108

1109
impl Add<&Self> for U8Vec3 {
1110
    type Output = Self;
1111
    #[inline]
1112
    fn add(self, rhs: &Self) -> Self {
3✔
1113
        self.add(*rhs)
3✔
1114
    }
1115
}
1116

1117
impl Add<&U8Vec3> for &U8Vec3 {
1118
    type Output = U8Vec3;
1119
    #[inline]
1120
    fn add(self, rhs: &U8Vec3) -> U8Vec3 {
3✔
1121
        (*self).add(*rhs)
3✔
1122
    }
1123
}
1124

1125
impl Add<U8Vec3> for &U8Vec3 {
1126
    type Output = U8Vec3;
1127
    #[inline]
1128
    fn add(self, rhs: U8Vec3) -> U8Vec3 {
3✔
1129
        (*self).add(rhs)
3✔
1130
    }
1131
}
1132

1133
impl AddAssign for U8Vec3 {
1134
    #[inline]
1135
    fn add_assign(&mut self, rhs: Self) {
3✔
1136
        self.x.add_assign(rhs.x);
3✔
1137
        self.y.add_assign(rhs.y);
5✔
1138
        self.z.add_assign(rhs.z);
5✔
1139
    }
1140
}
1141

1142
impl AddAssign<&Self> for U8Vec3 {
1143
    #[inline]
1144
    fn add_assign(&mut self, rhs: &Self) {
3✔
1145
        self.add_assign(*rhs);
3✔
1146
    }
1147
}
1148

1149
impl Add<u8> for U8Vec3 {
1150
    type Output = Self;
1151
    #[inline]
1152
    fn add(self, rhs: u8) -> Self {
3✔
1153
        Self {
1154
            x: self.x.add(rhs),
3✔
1155
            y: self.y.add(rhs),
3✔
1156
            z: self.z.add(rhs),
3✔
1157
        }
1158
    }
1159
}
1160

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

1169
impl Add<&u8> for &U8Vec3 {
1170
    type Output = U8Vec3;
1171
    #[inline]
1172
    fn add(self, rhs: &u8) -> U8Vec3 {
3✔
1173
        (*self).add(*rhs)
3✔
1174
    }
1175
}
1176

1177
impl Add<u8> for &U8Vec3 {
1178
    type Output = U8Vec3;
1179
    #[inline]
1180
    fn add(self, rhs: u8) -> U8Vec3 {
3✔
1181
        (*self).add(rhs)
3✔
1182
    }
1183
}
1184

1185
impl AddAssign<u8> for U8Vec3 {
1186
    #[inline]
1187
    fn add_assign(&mut self, rhs: u8) {
3✔
1188
        self.x.add_assign(rhs);
3✔
1189
        self.y.add_assign(rhs);
3✔
1190
        self.z.add_assign(rhs);
5✔
1191
    }
1192
}
1193

1194
impl AddAssign<&u8> for U8Vec3 {
1195
    #[inline]
1196
    fn add_assign(&mut self, rhs: &u8) {
3✔
1197
        self.add_assign(*rhs);
3✔
1198
    }
1199
}
1200

1201
impl Add<U8Vec3> for u8 {
1202
    type Output = U8Vec3;
1203
    #[inline]
1204
    fn add(self, rhs: U8Vec3) -> U8Vec3 {
3✔
1205
        U8Vec3 {
1206
            x: self.add(rhs.x),
3✔
1207
            y: self.add(rhs.y),
3✔
1208
            z: self.add(rhs.z),
3✔
1209
        }
1210
    }
1211
}
1212

1213
impl Add<&U8Vec3> for u8 {
1214
    type Output = U8Vec3;
1215
    #[inline]
1216
    fn add(self, rhs: &U8Vec3) -> U8Vec3 {
3✔
1217
        self.add(*rhs)
3✔
1218
    }
1219
}
1220

1221
impl Add<&U8Vec3> for &u8 {
1222
    type Output = U8Vec3;
1223
    #[inline]
1224
    fn add(self, rhs: &U8Vec3) -> U8Vec3 {
3✔
1225
        (*self).add(*rhs)
3✔
1226
    }
1227
}
1228

1229
impl Add<U8Vec3> for &u8 {
1230
    type Output = U8Vec3;
1231
    #[inline]
1232
    fn add(self, rhs: U8Vec3) -> U8Vec3 {
3✔
1233
        (*self).add(rhs)
3✔
1234
    }
1235
}
1236

1237
impl Sub for U8Vec3 {
1238
    type Output = Self;
1239
    #[inline]
1240
    fn sub(self, rhs: Self) -> Self {
3✔
1241
        Self {
1242
            x: self.x.sub(rhs.x),
3✔
1243
            y: self.y.sub(rhs.y),
3✔
1244
            z: self.z.sub(rhs.z),
3✔
1245
        }
1246
    }
1247
}
1248

1249
impl Sub<&Self> for U8Vec3 {
1250
    type Output = Self;
1251
    #[inline]
1252
    fn sub(self, rhs: &Self) -> Self {
3✔
1253
        self.sub(*rhs)
3✔
1254
    }
1255
}
1256

1257
impl Sub<&U8Vec3> for &U8Vec3 {
1258
    type Output = U8Vec3;
1259
    #[inline]
1260
    fn sub(self, rhs: &U8Vec3) -> U8Vec3 {
3✔
1261
        (*self).sub(*rhs)
3✔
1262
    }
1263
}
1264

1265
impl Sub<U8Vec3> for &U8Vec3 {
1266
    type Output = U8Vec3;
1267
    #[inline]
1268
    fn sub(self, rhs: U8Vec3) -> U8Vec3 {
3✔
1269
        (*self).sub(rhs)
3✔
1270
    }
1271
}
1272

1273
impl SubAssign for U8Vec3 {
1274
    #[inline]
1275
    fn sub_assign(&mut self, rhs: Self) {
3✔
1276
        self.x.sub_assign(rhs.x);
3✔
1277
        self.y.sub_assign(rhs.y);
5✔
1278
        self.z.sub_assign(rhs.z);
5✔
1279
    }
1280
}
1281

1282
impl SubAssign<&Self> for U8Vec3 {
1283
    #[inline]
1284
    fn sub_assign(&mut self, rhs: &Self) {
3✔
1285
        self.sub_assign(*rhs);
3✔
1286
    }
1287
}
1288

1289
impl Sub<u8> for U8Vec3 {
1290
    type Output = Self;
1291
    #[inline]
1292
    fn sub(self, rhs: u8) -> Self {
3✔
1293
        Self {
1294
            x: self.x.sub(rhs),
3✔
1295
            y: self.y.sub(rhs),
3✔
1296
            z: self.z.sub(rhs),
3✔
1297
        }
1298
    }
1299
}
1300

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

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

1317
impl Sub<u8> for &U8Vec3 {
1318
    type Output = U8Vec3;
1319
    #[inline]
1320
    fn sub(self, rhs: u8) -> U8Vec3 {
3✔
1321
        (*self).sub(rhs)
3✔
1322
    }
1323
}
1324

1325
impl SubAssign<u8> for U8Vec3 {
1326
    #[inline]
1327
    fn sub_assign(&mut self, rhs: u8) {
3✔
1328
        self.x.sub_assign(rhs);
3✔
1329
        self.y.sub_assign(rhs);
5✔
1330
        self.z.sub_assign(rhs);
5✔
1331
    }
1332
}
1333

1334
impl SubAssign<&u8> for U8Vec3 {
1335
    #[inline]
1336
    fn sub_assign(&mut self, rhs: &u8) {
3✔
1337
        self.sub_assign(*rhs);
3✔
1338
    }
1339
}
1340

1341
impl Sub<U8Vec3> for u8 {
1342
    type Output = U8Vec3;
1343
    #[inline]
1344
    fn sub(self, rhs: U8Vec3) -> U8Vec3 {
3✔
1345
        U8Vec3 {
1346
            x: self.sub(rhs.x),
3✔
1347
            y: self.sub(rhs.y),
3✔
1348
            z: self.sub(rhs.z),
3✔
1349
        }
1350
    }
1351
}
1352

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

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

1369
impl Sub<U8Vec3> for &u8 {
1370
    type Output = U8Vec3;
1371
    #[inline]
1372
    fn sub(self, rhs: U8Vec3) -> U8Vec3 {
3✔
1373
        (*self).sub(rhs)
3✔
1374
    }
1375
}
1376

1377
impl Rem for U8Vec3 {
1378
    type Output = Self;
1379
    #[inline]
1380
    fn rem(self, rhs: Self) -> Self {
3✔
1381
        Self {
1382
            x: self.x.rem(rhs.x),
3✔
1383
            y: self.y.rem(rhs.y),
3✔
1384
            z: self.z.rem(rhs.z),
3✔
1385
        }
1386
    }
1387
}
1388

1389
impl Rem<&Self> for U8Vec3 {
1390
    type Output = Self;
1391
    #[inline]
1392
    fn rem(self, rhs: &Self) -> Self {
3✔
1393
        self.rem(*rhs)
3✔
1394
    }
1395
}
1396

1397
impl Rem<&U8Vec3> for &U8Vec3 {
1398
    type Output = U8Vec3;
1399
    #[inline]
1400
    fn rem(self, rhs: &U8Vec3) -> U8Vec3 {
3✔
1401
        (*self).rem(*rhs)
3✔
1402
    }
1403
}
1404

1405
impl Rem<U8Vec3> for &U8Vec3 {
1406
    type Output = U8Vec3;
1407
    #[inline]
1408
    fn rem(self, rhs: U8Vec3) -> U8Vec3 {
3✔
1409
        (*self).rem(rhs)
3✔
1410
    }
1411
}
1412

1413
impl RemAssign for U8Vec3 {
1414
    #[inline]
1415
    fn rem_assign(&mut self, rhs: Self) {
3✔
1416
        self.x.rem_assign(rhs.x);
3✔
1417
        self.y.rem_assign(rhs.y);
5✔
1418
        self.z.rem_assign(rhs.z);
5✔
1419
    }
1420
}
1421

1422
impl RemAssign<&Self> for U8Vec3 {
1423
    #[inline]
1424
    fn rem_assign(&mut self, rhs: &Self) {
3✔
1425
        self.rem_assign(*rhs);
3✔
1426
    }
1427
}
1428

1429
impl Rem<u8> for U8Vec3 {
1430
    type Output = Self;
1431
    #[inline]
1432
    fn rem(self, rhs: u8) -> Self {
3✔
1433
        Self {
1434
            x: self.x.rem(rhs),
3✔
1435
            y: self.y.rem(rhs),
3✔
1436
            z: self.z.rem(rhs),
3✔
1437
        }
1438
    }
1439
}
1440

1441
impl Rem<&u8> for U8Vec3 {
1442
    type Output = Self;
1443
    #[inline]
1444
    fn rem(self, rhs: &u8) -> Self {
3✔
1445
        self.rem(*rhs)
3✔
1446
    }
1447
}
1448

1449
impl Rem<&u8> for &U8Vec3 {
1450
    type Output = U8Vec3;
1451
    #[inline]
1452
    fn rem(self, rhs: &u8) -> U8Vec3 {
3✔
1453
        (*self).rem(*rhs)
3✔
1454
    }
1455
}
1456

1457
impl Rem<u8> for &U8Vec3 {
1458
    type Output = U8Vec3;
1459
    #[inline]
1460
    fn rem(self, rhs: u8) -> U8Vec3 {
3✔
1461
        (*self).rem(rhs)
3✔
1462
    }
1463
}
1464

1465
impl RemAssign<u8> for U8Vec3 {
1466
    #[inline]
1467
    fn rem_assign(&mut self, rhs: u8) {
3✔
1468
        self.x.rem_assign(rhs);
3✔
1469
        self.y.rem_assign(rhs);
5✔
1470
        self.z.rem_assign(rhs);
5✔
1471
    }
1472
}
1473

1474
impl RemAssign<&u8> for U8Vec3 {
1475
    #[inline]
1476
    fn rem_assign(&mut self, rhs: &u8) {
3✔
1477
        self.rem_assign(*rhs);
3✔
1478
    }
1479
}
1480

1481
impl Rem<U8Vec3> for u8 {
1482
    type Output = U8Vec3;
1483
    #[inline]
1484
    fn rem(self, rhs: U8Vec3) -> U8Vec3 {
3✔
1485
        U8Vec3 {
1486
            x: self.rem(rhs.x),
3✔
1487
            y: self.rem(rhs.y),
3✔
1488
            z: self.rem(rhs.z),
3✔
1489
        }
1490
    }
1491
}
1492

1493
impl Rem<&U8Vec3> for u8 {
1494
    type Output = U8Vec3;
1495
    #[inline]
1496
    fn rem(self, rhs: &U8Vec3) -> U8Vec3 {
3✔
1497
        self.rem(*rhs)
3✔
1498
    }
1499
}
1500

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

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

1517
impl AsRef<[u8; 3]> for U8Vec3 {
1518
    #[inline]
1519
    fn as_ref(&self) -> &[u8; 3] {
3✔
1520
        unsafe { &*(self as *const Self as *const [u8; 3]) }
3✔
1521
    }
1522
}
1523

1524
impl AsMut<[u8; 3]> for U8Vec3 {
1525
    #[inline]
1526
    fn as_mut(&mut self) -> &mut [u8; 3] {
3✔
1527
        unsafe { &mut *(self as *mut Self as *mut [u8; 3]) }
3✔
1528
    }
1529
}
1530

1531
impl Sum for U8Vec3 {
1532
    #[inline]
1533
    fn sum<I>(iter: I) -> Self
3✔
1534
    where
1535
        I: Iterator<Item = Self>,
1536
    {
1537
        iter.fold(Self::ZERO, Self::add)
3✔
1538
    }
1539
}
1540

1541
impl<'a> Sum<&'a Self> for U8Vec3 {
1542
    #[inline]
1543
    fn sum<I>(iter: I) -> Self
3✔
1544
    where
1545
        I: Iterator<Item = &'a Self>,
1546
    {
1547
        iter.fold(Self::ZERO, |a, &b| Self::add(a, b))
9✔
1548
    }
1549
}
1550

1551
impl Product for U8Vec3 {
1552
    #[inline]
1553
    fn product<I>(iter: I) -> Self
3✔
1554
    where
1555
        I: Iterator<Item = Self>,
1556
    {
1557
        iter.fold(Self::ONE, Self::mul)
3✔
1558
    }
1559
}
1560

1561
impl<'a> Product<&'a Self> for U8Vec3 {
1562
    #[inline]
1563
    fn product<I>(iter: I) -> Self
3✔
1564
    where
1565
        I: Iterator<Item = &'a Self>,
1566
    {
1567
        iter.fold(Self::ONE, |a, &b| Self::mul(a, b))
9✔
1568
    }
1569
}
1570

1571
impl Not for U8Vec3 {
1572
    type Output = Self;
1573
    #[inline]
1574
    fn not(self) -> Self {
3✔
1575
        Self {
1576
            x: self.x.not(),
3✔
1577
            y: self.y.not(),
3✔
1578
            z: self.z.not(),
3✔
1579
        }
1580
    }
1581
}
1582

1583
impl Not for &U8Vec3 {
1584
    type Output = U8Vec3;
1585
    #[inline]
1586
    fn not(self) -> U8Vec3 {
3✔
1587
        (*self).not()
3✔
1588
    }
1589
}
1590

1591
impl BitAnd for U8Vec3 {
1592
    type Output = Self;
1593
    #[inline]
1594
    fn bitand(self, rhs: Self) -> Self::Output {
3✔
1595
        Self {
1596
            x: self.x.bitand(rhs.x),
3✔
1597
            y: self.y.bitand(rhs.y),
3✔
1598
            z: self.z.bitand(rhs.z),
3✔
1599
        }
1600
    }
1601
}
1602

1603
impl BitAnd<&Self> for U8Vec3 {
1604
    type Output = Self;
1605
    #[inline]
1606
    fn bitand(self, rhs: &Self) -> Self {
3✔
1607
        self.bitand(*rhs)
3✔
1608
    }
1609
}
1610

1611
impl BitAnd<&U8Vec3> for &U8Vec3 {
1612
    type Output = U8Vec3;
1613
    #[inline]
1614
    fn bitand(self, rhs: &U8Vec3) -> U8Vec3 {
3✔
1615
        (*self).bitand(*rhs)
3✔
1616
    }
1617
}
1618

1619
impl BitAnd<U8Vec3> for &U8Vec3 {
1620
    type Output = U8Vec3;
1621
    #[inline]
1622
    fn bitand(self, rhs: U8Vec3) -> U8Vec3 {
3✔
1623
        (*self).bitand(rhs)
3✔
1624
    }
1625
}
1626

1627
impl BitAndAssign for U8Vec3 {
1628
    #[inline]
1629
    fn bitand_assign(&mut self, rhs: Self) {
3✔
1630
        *self = self.bitand(rhs);
3✔
1631
    }
1632
}
1633

1634
impl BitAndAssign<&Self> for U8Vec3 {
1635
    #[inline]
1636
    fn bitand_assign(&mut self, rhs: &Self) {
3✔
1637
        self.bitand_assign(*rhs);
3✔
1638
    }
1639
}
1640

1641
impl BitOr for U8Vec3 {
1642
    type Output = Self;
1643
    #[inline]
1644
    fn bitor(self, rhs: Self) -> Self::Output {
3✔
1645
        Self {
1646
            x: self.x.bitor(rhs.x),
3✔
1647
            y: self.y.bitor(rhs.y),
3✔
1648
            z: self.z.bitor(rhs.z),
3✔
1649
        }
1650
    }
1651
}
1652

1653
impl BitOr<&Self> for U8Vec3 {
1654
    type Output = Self;
1655
    #[inline]
1656
    fn bitor(self, rhs: &Self) -> Self {
3✔
1657
        self.bitor(*rhs)
3✔
1658
    }
1659
}
1660

1661
impl BitOr<&U8Vec3> for &U8Vec3 {
1662
    type Output = U8Vec3;
1663
    #[inline]
1664
    fn bitor(self, rhs: &U8Vec3) -> U8Vec3 {
3✔
1665
        (*self).bitor(*rhs)
3✔
1666
    }
1667
}
1668

1669
impl BitOr<U8Vec3> for &U8Vec3 {
1670
    type Output = U8Vec3;
1671
    #[inline]
1672
    fn bitor(self, rhs: U8Vec3) -> U8Vec3 {
3✔
1673
        (*self).bitor(rhs)
3✔
1674
    }
1675
}
1676

1677
impl BitOrAssign for U8Vec3 {
1678
    #[inline]
1679
    fn bitor_assign(&mut self, rhs: Self) {
3✔
1680
        *self = self.bitor(rhs);
3✔
1681
    }
1682
}
1683

1684
impl BitOrAssign<&Self> for U8Vec3 {
1685
    #[inline]
1686
    fn bitor_assign(&mut self, rhs: &Self) {
3✔
1687
        self.bitor_assign(*rhs);
3✔
1688
    }
1689
}
1690

1691
impl BitXor for U8Vec3 {
1692
    type Output = Self;
1693
    #[inline]
1694
    fn bitxor(self, rhs: Self) -> Self::Output {
3✔
1695
        Self {
1696
            x: self.x.bitxor(rhs.x),
3✔
1697
            y: self.y.bitxor(rhs.y),
3✔
1698
            z: self.z.bitxor(rhs.z),
3✔
1699
        }
1700
    }
1701
}
1702

1703
impl BitXor<&Self> for U8Vec3 {
1704
    type Output = Self;
1705
    #[inline]
1706
    fn bitxor(self, rhs: &Self) -> Self {
3✔
1707
        self.bitxor(*rhs)
3✔
1708
    }
1709
}
1710

1711
impl BitXor<&U8Vec3> for &U8Vec3 {
1712
    type Output = U8Vec3;
1713
    #[inline]
1714
    fn bitxor(self, rhs: &U8Vec3) -> U8Vec3 {
3✔
1715
        (*self).bitxor(*rhs)
3✔
1716
    }
1717
}
1718

1719
impl BitXor<U8Vec3> for &U8Vec3 {
1720
    type Output = U8Vec3;
1721
    #[inline]
1722
    fn bitxor(self, rhs: U8Vec3) -> U8Vec3 {
3✔
1723
        (*self).bitxor(rhs)
3✔
1724
    }
1725
}
1726

1727
impl BitXorAssign for U8Vec3 {
1728
    #[inline]
1729
    fn bitxor_assign(&mut self, rhs: Self) {
3✔
1730
        *self = self.bitxor(rhs);
3✔
1731
    }
1732
}
1733

1734
impl BitXorAssign<&Self> for U8Vec3 {
1735
    #[inline]
1736
    fn bitxor_assign(&mut self, rhs: &Self) {
3✔
1737
        self.bitxor_assign(*rhs);
3✔
1738
    }
1739
}
1740

1741
impl BitAnd<u8> for U8Vec3 {
1742
    type Output = Self;
1743
    #[inline]
1744
    fn bitand(self, rhs: u8) -> Self::Output {
3✔
1745
        Self {
1746
            x: self.x.bitand(rhs),
3✔
1747
            y: self.y.bitand(rhs),
3✔
1748
            z: self.z.bitand(rhs),
3✔
1749
        }
1750
    }
1751
}
1752

1753
impl BitAnd<&u8> for U8Vec3 {
1754
    type Output = Self;
1755
    #[inline]
1756
    fn bitand(self, rhs: &u8) -> Self {
3✔
1757
        self.bitand(*rhs)
3✔
1758
    }
1759
}
1760

1761
impl BitAnd<&u8> for &U8Vec3 {
1762
    type Output = U8Vec3;
1763
    #[inline]
1764
    fn bitand(self, rhs: &u8) -> U8Vec3 {
3✔
1765
        (*self).bitand(*rhs)
3✔
1766
    }
1767
}
1768

1769
impl BitAnd<u8> for &U8Vec3 {
1770
    type Output = U8Vec3;
1771
    #[inline]
1772
    fn bitand(self, rhs: u8) -> U8Vec3 {
3✔
1773
        (*self).bitand(rhs)
3✔
1774
    }
1775
}
1776

1777
impl BitAndAssign<u8> for U8Vec3 {
1778
    #[inline]
1779
    fn bitand_assign(&mut self, rhs: u8) {
3✔
1780
        *self = self.bitand(rhs);
3✔
1781
    }
1782
}
1783

1784
impl BitAndAssign<&u8> for U8Vec3 {
1785
    #[inline]
1786
    fn bitand_assign(&mut self, rhs: &u8) {
3✔
1787
        self.bitand_assign(*rhs);
3✔
1788
    }
1789
}
1790

1791
impl BitOr<u8> for U8Vec3 {
1792
    type Output = Self;
1793
    #[inline]
1794
    fn bitor(self, rhs: u8) -> Self::Output {
3✔
1795
        Self {
1796
            x: self.x.bitor(rhs),
3✔
1797
            y: self.y.bitor(rhs),
3✔
1798
            z: self.z.bitor(rhs),
3✔
1799
        }
1800
    }
1801
}
1802

1803
impl BitOr<&u8> for U8Vec3 {
1804
    type Output = Self;
1805
    #[inline]
1806
    fn bitor(self, rhs: &u8) -> Self {
3✔
1807
        self.bitor(*rhs)
3✔
1808
    }
1809
}
1810

1811
impl BitOr<&u8> for &U8Vec3 {
1812
    type Output = U8Vec3;
1813
    #[inline]
1814
    fn bitor(self, rhs: &u8) -> U8Vec3 {
3✔
1815
        (*self).bitor(*rhs)
3✔
1816
    }
1817
}
1818

1819
impl BitOr<u8> for &U8Vec3 {
1820
    type Output = U8Vec3;
1821
    #[inline]
1822
    fn bitor(self, rhs: u8) -> U8Vec3 {
3✔
1823
        (*self).bitor(rhs)
3✔
1824
    }
1825
}
1826

1827
impl BitOrAssign<u8> for U8Vec3 {
1828
    #[inline]
1829
    fn bitor_assign(&mut self, rhs: u8) {
3✔
1830
        *self = self.bitor(rhs);
3✔
1831
    }
1832
}
1833

1834
impl BitOrAssign<&u8> for U8Vec3 {
1835
    #[inline]
1836
    fn bitor_assign(&mut self, rhs: &u8) {
3✔
1837
        self.bitor_assign(*rhs);
3✔
1838
    }
1839
}
1840

1841
impl BitXor<u8> for U8Vec3 {
1842
    type Output = Self;
1843
    #[inline]
1844
    fn bitxor(self, rhs: u8) -> Self::Output {
3✔
1845
        Self {
1846
            x: self.x.bitxor(rhs),
3✔
1847
            y: self.y.bitxor(rhs),
3✔
1848
            z: self.z.bitxor(rhs),
3✔
1849
        }
1850
    }
1851
}
1852

1853
impl BitXor<&u8> for U8Vec3 {
1854
    type Output = Self;
1855
    #[inline]
1856
    fn bitxor(self, rhs: &u8) -> Self {
3✔
1857
        self.bitxor(*rhs)
3✔
1858
    }
1859
}
1860

1861
impl BitXor<&u8> for &U8Vec3 {
1862
    type Output = U8Vec3;
1863
    #[inline]
1864
    fn bitxor(self, rhs: &u8) -> U8Vec3 {
3✔
1865
        (*self).bitxor(*rhs)
3✔
1866
    }
1867
}
1868

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

1877
impl BitXorAssign<u8> for U8Vec3 {
1878
    #[inline]
1879
    fn bitxor_assign(&mut self, rhs: u8) {
3✔
1880
        *self = self.bitxor(rhs);
3✔
1881
    }
1882
}
1883

1884
impl BitXorAssign<&u8> for U8Vec3 {
1885
    #[inline]
1886
    fn bitxor_assign(&mut self, rhs: &u8) {
3✔
1887
        self.bitxor_assign(*rhs);
3✔
1888
    }
1889
}
1890

1891
impl Shl<i8> for U8Vec3 {
1892
    type Output = Self;
1893
    #[inline]
1894
    fn shl(self, rhs: i8) -> Self::Output {
3✔
1895
        Self {
1896
            x: self.x.shl(rhs),
3✔
1897
            y: self.y.shl(rhs),
3✔
1898
            z: self.z.shl(rhs),
3✔
1899
        }
1900
    }
1901
}
1902

1903
impl Shl<&i8> for U8Vec3 {
1904
    type Output = Self;
1905
    #[inline]
1906
    fn shl(self, rhs: &i8) -> Self {
3✔
1907
        self.shl(*rhs)
3✔
1908
    }
1909
}
1910

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

1919
impl Shl<i8> for &U8Vec3 {
1920
    type Output = U8Vec3;
1921
    #[inline]
1922
    fn shl(self, rhs: i8) -> U8Vec3 {
3✔
1923
        (*self).shl(rhs)
3✔
1924
    }
1925
}
1926

1927
impl ShlAssign<i8> for U8Vec3 {
1928
    #[inline]
1929
    fn shl_assign(&mut self, rhs: i8) {
3✔
1930
        *self = self.shl(rhs);
3✔
1931
    }
1932
}
1933

1934
impl ShlAssign<&i8> for U8Vec3 {
1935
    #[inline]
1936
    fn shl_assign(&mut self, rhs: &i8) {
3✔
1937
        self.shl_assign(*rhs);
3✔
1938
    }
1939
}
1940

1941
impl Shr<i8> for U8Vec3 {
1942
    type Output = Self;
1943
    #[inline]
1944
    fn shr(self, rhs: i8) -> Self::Output {
3✔
1945
        Self {
1946
            x: self.x.shr(rhs),
3✔
1947
            y: self.y.shr(rhs),
3✔
1948
            z: self.z.shr(rhs),
3✔
1949
        }
1950
    }
1951
}
1952

1953
impl Shr<&i8> for U8Vec3 {
1954
    type Output = Self;
1955
    #[inline]
1956
    fn shr(self, rhs: &i8) -> Self {
3✔
1957
        self.shr(*rhs)
3✔
1958
    }
1959
}
1960

1961
impl Shr<&i8> for &U8Vec3 {
1962
    type Output = U8Vec3;
1963
    #[inline]
1964
    fn shr(self, rhs: &i8) -> U8Vec3 {
3✔
1965
        (*self).shr(*rhs)
3✔
1966
    }
1967
}
1968

1969
impl Shr<i8> for &U8Vec3 {
1970
    type Output = U8Vec3;
1971
    #[inline]
1972
    fn shr(self, rhs: i8) -> U8Vec3 {
3✔
1973
        (*self).shr(rhs)
3✔
1974
    }
1975
}
1976

1977
impl ShrAssign<i8> for U8Vec3 {
1978
    #[inline]
1979
    fn shr_assign(&mut self, rhs: i8) {
3✔
1980
        *self = self.shr(rhs);
3✔
1981
    }
1982
}
1983

1984
impl ShrAssign<&i8> for U8Vec3 {
1985
    #[inline]
1986
    fn shr_assign(&mut self, rhs: &i8) {
3✔
1987
        self.shr_assign(*rhs);
3✔
1988
    }
1989
}
1990

1991
impl Shl<i16> for U8Vec3 {
1992
    type Output = Self;
1993
    #[inline]
1994
    fn shl(self, rhs: i16) -> Self::Output {
3✔
1995
        Self {
1996
            x: self.x.shl(rhs),
3✔
1997
            y: self.y.shl(rhs),
3✔
1998
            z: self.z.shl(rhs),
3✔
1999
        }
2000
    }
2001
}
2002

2003
impl Shl<&i16> for U8Vec3 {
2004
    type Output = Self;
2005
    #[inline]
2006
    fn shl(self, rhs: &i16) -> Self {
3✔
2007
        self.shl(*rhs)
3✔
2008
    }
2009
}
2010

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

2019
impl Shl<i16> for &U8Vec3 {
2020
    type Output = U8Vec3;
2021
    #[inline]
2022
    fn shl(self, rhs: i16) -> U8Vec3 {
3✔
2023
        (*self).shl(rhs)
3✔
2024
    }
2025
}
2026

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

2034
impl ShlAssign<&i16> for U8Vec3 {
2035
    #[inline]
2036
    fn shl_assign(&mut self, rhs: &i16) {
3✔
2037
        self.shl_assign(*rhs);
3✔
2038
    }
2039
}
2040

2041
impl Shr<i16> for U8Vec3 {
2042
    type Output = Self;
2043
    #[inline]
2044
    fn shr(self, rhs: i16) -> Self::Output {
3✔
2045
        Self {
2046
            x: self.x.shr(rhs),
3✔
2047
            y: self.y.shr(rhs),
3✔
2048
            z: self.z.shr(rhs),
3✔
2049
        }
2050
    }
2051
}
2052

2053
impl Shr<&i16> for U8Vec3 {
2054
    type Output = Self;
2055
    #[inline]
2056
    fn shr(self, rhs: &i16) -> Self {
3✔
2057
        self.shr(*rhs)
3✔
2058
    }
2059
}
2060

2061
impl Shr<&i16> for &U8Vec3 {
2062
    type Output = U8Vec3;
2063
    #[inline]
2064
    fn shr(self, rhs: &i16) -> U8Vec3 {
3✔
2065
        (*self).shr(*rhs)
3✔
2066
    }
2067
}
2068

2069
impl Shr<i16> for &U8Vec3 {
2070
    type Output = U8Vec3;
2071
    #[inline]
2072
    fn shr(self, rhs: i16) -> U8Vec3 {
3✔
2073
        (*self).shr(rhs)
3✔
2074
    }
2075
}
2076

2077
impl ShrAssign<i16> for U8Vec3 {
2078
    #[inline]
2079
    fn shr_assign(&mut self, rhs: i16) {
3✔
2080
        *self = self.shr(rhs);
3✔
2081
    }
2082
}
2083

2084
impl ShrAssign<&i16> for U8Vec3 {
2085
    #[inline]
2086
    fn shr_assign(&mut self, rhs: &i16) {
3✔
2087
        self.shr_assign(*rhs);
3✔
2088
    }
2089
}
2090

2091
impl Shl<i32> for U8Vec3 {
2092
    type Output = Self;
2093
    #[inline]
2094
    fn shl(self, rhs: i32) -> Self::Output {
3✔
2095
        Self {
2096
            x: self.x.shl(rhs),
3✔
2097
            y: self.y.shl(rhs),
3✔
2098
            z: self.z.shl(rhs),
3✔
2099
        }
2100
    }
2101
}
2102

2103
impl Shl<&i32> for U8Vec3 {
2104
    type Output = Self;
2105
    #[inline]
2106
    fn shl(self, rhs: &i32) -> Self {
3✔
2107
        self.shl(*rhs)
3✔
2108
    }
2109
}
2110

2111
impl Shl<&i32> for &U8Vec3 {
2112
    type Output = U8Vec3;
2113
    #[inline]
2114
    fn shl(self, rhs: &i32) -> U8Vec3 {
3✔
2115
        (*self).shl(*rhs)
3✔
2116
    }
2117
}
2118

2119
impl Shl<i32> for &U8Vec3 {
2120
    type Output = U8Vec3;
2121
    #[inline]
2122
    fn shl(self, rhs: i32) -> U8Vec3 {
3✔
2123
        (*self).shl(rhs)
3✔
2124
    }
2125
}
2126

2127
impl ShlAssign<i32> for U8Vec3 {
2128
    #[inline]
2129
    fn shl_assign(&mut self, rhs: i32) {
3✔
2130
        *self = self.shl(rhs);
3✔
2131
    }
2132
}
2133

2134
impl ShlAssign<&i32> for U8Vec3 {
2135
    #[inline]
2136
    fn shl_assign(&mut self, rhs: &i32) {
3✔
2137
        self.shl_assign(*rhs);
3✔
2138
    }
2139
}
2140

2141
impl Shr<i32> for U8Vec3 {
2142
    type Output = Self;
2143
    #[inline]
2144
    fn shr(self, rhs: i32) -> Self::Output {
3✔
2145
        Self {
2146
            x: self.x.shr(rhs),
3✔
2147
            y: self.y.shr(rhs),
3✔
2148
            z: self.z.shr(rhs),
3✔
2149
        }
2150
    }
2151
}
2152

2153
impl Shr<&i32> for U8Vec3 {
2154
    type Output = Self;
2155
    #[inline]
2156
    fn shr(self, rhs: &i32) -> Self {
3✔
2157
        self.shr(*rhs)
3✔
2158
    }
2159
}
2160

2161
impl Shr<&i32> for &U8Vec3 {
2162
    type Output = U8Vec3;
2163
    #[inline]
2164
    fn shr(self, rhs: &i32) -> U8Vec3 {
3✔
2165
        (*self).shr(*rhs)
3✔
2166
    }
2167
}
2168

2169
impl Shr<i32> for &U8Vec3 {
2170
    type Output = U8Vec3;
2171
    #[inline]
2172
    fn shr(self, rhs: i32) -> U8Vec3 {
3✔
2173
        (*self).shr(rhs)
3✔
2174
    }
2175
}
2176

2177
impl ShrAssign<i32> for U8Vec3 {
2178
    #[inline]
2179
    fn shr_assign(&mut self, rhs: i32) {
3✔
2180
        *self = self.shr(rhs);
3✔
2181
    }
2182
}
2183

2184
impl ShrAssign<&i32> for U8Vec3 {
2185
    #[inline]
2186
    fn shr_assign(&mut self, rhs: &i32) {
3✔
2187
        self.shr_assign(*rhs);
3✔
2188
    }
2189
}
2190

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

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

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

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

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

2234
impl ShlAssign<&i64> for U8Vec3 {
2235
    #[inline]
2236
    fn shl_assign(&mut self, rhs: &i64) {
3✔
2237
        self.shl_assign(*rhs);
3✔
2238
    }
2239
}
2240

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

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

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

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

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

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

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

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

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

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

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

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

2341
impl Shr<u8> for U8Vec3 {
2342
    type Output = Self;
2343
    #[inline]
2344
    fn shr(self, rhs: u8) -> 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
        }
2350
    }
2351
}
2352

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

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

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

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

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

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

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

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

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

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

2434
impl ShlAssign<&u16> for U8Vec3 {
2435
    #[inline]
2436
    fn shl_assign(&mut self, rhs: &u16) {
3✔
2437
        self.shl_assign(*rhs);
3✔
2438
    }
2439
}
2440

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

2453
impl Shr<&u16> for U8Vec3 {
2454
    type Output = Self;
2455
    #[inline]
2456
    fn shr(self, rhs: &u16) -> Self {
3✔
2457
        self.shr(*rhs)
3✔
2458
    }
2459
}
2460

2461
impl Shr<&u16> for &U8Vec3 {
2462
    type Output = U8Vec3;
2463
    #[inline]
2464
    fn shr(self, rhs: &u16) -> U8Vec3 {
3✔
2465
        (*self).shr(*rhs)
3✔
2466
    }
2467
}
2468

2469
impl Shr<u16> for &U8Vec3 {
2470
    type Output = U8Vec3;
2471
    #[inline]
2472
    fn shr(self, rhs: u16) -> U8Vec3 {
3✔
2473
        (*self).shr(rhs)
3✔
2474
    }
2475
}
2476

2477
impl ShrAssign<u16> for U8Vec3 {
2478
    #[inline]
2479
    fn shr_assign(&mut self, rhs: u16) {
3✔
2480
        *self = self.shr(rhs);
3✔
2481
    }
2482
}
2483

2484
impl ShrAssign<&u16> for U8Vec3 {
2485
    #[inline]
2486
    fn shr_assign(&mut self, rhs: &u16) {
3✔
2487
        self.shr_assign(*rhs);
3✔
2488
    }
2489
}
2490

2491
impl Shl<u32> for U8Vec3 {
2492
    type Output = Self;
2493
    #[inline]
2494
    fn shl(self, rhs: u32) -> Self::Output {
3✔
2495
        Self {
2496
            x: self.x.shl(rhs),
3✔
2497
            y: self.y.shl(rhs),
3✔
2498
            z: self.z.shl(rhs),
3✔
2499
        }
2500
    }
2501
}
2502

2503
impl Shl<&u32> for U8Vec3 {
2504
    type Output = Self;
2505
    #[inline]
2506
    fn shl(self, rhs: &u32) -> Self {
3✔
2507
        self.shl(*rhs)
3✔
2508
    }
2509
}
2510

2511
impl Shl<&u32> for &U8Vec3 {
2512
    type Output = U8Vec3;
2513
    #[inline]
2514
    fn shl(self, rhs: &u32) -> U8Vec3 {
3✔
2515
        (*self).shl(*rhs)
3✔
2516
    }
2517
}
2518

2519
impl Shl<u32> for &U8Vec3 {
2520
    type Output = U8Vec3;
2521
    #[inline]
2522
    fn shl(self, rhs: u32) -> U8Vec3 {
3✔
2523
        (*self).shl(rhs)
3✔
2524
    }
2525
}
2526

2527
impl ShlAssign<u32> for U8Vec3 {
2528
    #[inline]
2529
    fn shl_assign(&mut self, rhs: u32) {
3✔
2530
        *self = self.shl(rhs);
3✔
2531
    }
2532
}
2533

2534
impl ShlAssign<&u32> for U8Vec3 {
2535
    #[inline]
2536
    fn shl_assign(&mut self, rhs: &u32) {
3✔
2537
        self.shl_assign(*rhs);
3✔
2538
    }
2539
}
2540

2541
impl Shr<u32> for U8Vec3 {
2542
    type Output = Self;
2543
    #[inline]
2544
    fn shr(self, rhs: u32) -> Self::Output {
3✔
2545
        Self {
2546
            x: self.x.shr(rhs),
3✔
2547
            y: self.y.shr(rhs),
3✔
2548
            z: self.z.shr(rhs),
3✔
2549
        }
2550
    }
2551
}
2552

2553
impl Shr<&u32> for U8Vec3 {
2554
    type Output = Self;
2555
    #[inline]
2556
    fn shr(self, rhs: &u32) -> Self {
3✔
2557
        self.shr(*rhs)
3✔
2558
    }
2559
}
2560

2561
impl Shr<&u32> for &U8Vec3 {
2562
    type Output = U8Vec3;
2563
    #[inline]
2564
    fn shr(self, rhs: &u32) -> U8Vec3 {
3✔
2565
        (*self).shr(*rhs)
3✔
2566
    }
2567
}
2568

2569
impl Shr<u32> for &U8Vec3 {
2570
    type Output = U8Vec3;
2571
    #[inline]
2572
    fn shr(self, rhs: u32) -> U8Vec3 {
3✔
2573
        (*self).shr(rhs)
3✔
2574
    }
2575
}
2576

2577
impl ShrAssign<u32> for U8Vec3 {
2578
    #[inline]
2579
    fn shr_assign(&mut self, rhs: u32) {
3✔
2580
        *self = self.shr(rhs);
3✔
2581
    }
2582
}
2583

2584
impl ShrAssign<&u32> for U8Vec3 {
2585
    #[inline]
2586
    fn shr_assign(&mut self, rhs: &u32) {
3✔
2587
        self.shr_assign(*rhs);
3✔
2588
    }
2589
}
2590

2591
impl Shl<u64> for U8Vec3 {
2592
    type Output = Self;
2593
    #[inline]
2594
    fn shl(self, rhs: u64) -> Self::Output {
3✔
2595
        Self {
2596
            x: self.x.shl(rhs),
3✔
2597
            y: self.y.shl(rhs),
3✔
2598
            z: self.z.shl(rhs),
3✔
2599
        }
2600
    }
2601
}
2602

2603
impl Shl<&u64> for U8Vec3 {
2604
    type Output = Self;
2605
    #[inline]
2606
    fn shl(self, rhs: &u64) -> Self {
3✔
2607
        self.shl(*rhs)
3✔
2608
    }
2609
}
2610

2611
impl Shl<&u64> for &U8Vec3 {
2612
    type Output = U8Vec3;
2613
    #[inline]
2614
    fn shl(self, rhs: &u64) -> U8Vec3 {
3✔
2615
        (*self).shl(*rhs)
3✔
2616
    }
2617
}
2618

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

2627
impl ShlAssign<u64> for U8Vec3 {
2628
    #[inline]
2629
    fn shl_assign(&mut self, rhs: u64) {
3✔
2630
        *self = self.shl(rhs);
3✔
2631
    }
2632
}
2633

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

2641
impl Shr<u64> for U8Vec3 {
2642
    type Output = Self;
2643
    #[inline]
2644
    fn shr(self, rhs: u64) -> Self::Output {
3✔
2645
        Self {
2646
            x: self.x.shr(rhs),
3✔
2647
            y: self.y.shr(rhs),
3✔
2648
            z: self.z.shr(rhs),
3✔
2649
        }
2650
    }
2651
}
2652

2653
impl Shr<&u64> for U8Vec3 {
2654
    type Output = Self;
2655
    #[inline]
2656
    fn shr(self, rhs: &u64) -> Self {
3✔
2657
        self.shr(*rhs)
3✔
2658
    }
2659
}
2660

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

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

2677
impl ShrAssign<u64> for U8Vec3 {
2678
    #[inline]
2679
    fn shr_assign(&mut self, rhs: u64) {
3✔
2680
        *self = self.shr(rhs);
3✔
2681
    }
2682
}
2683

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

2691
#[cfg(feature = "i32")]
2692

2693
impl Shl<IVec3> for U8Vec3 {
2694
    type Output = Self;
2695
    #[inline]
2696
    fn shl(self, rhs: IVec3) -> Self {
3✔
2697
        Self {
2698
            x: self.x.shl(rhs.x),
3✔
2699
            y: self.y.shl(rhs.y),
3✔
2700
            z: self.z.shl(rhs.z),
3✔
2701
        }
2702
    }
2703
}
2704

2705
#[cfg(feature = "i32")]
2706

2707
impl Shl<&IVec3> for U8Vec3 {
2708
    type Output = Self;
2709
    #[inline]
2710
    fn shl(self, rhs: &IVec3) -> Self {
3✔
2711
        self.shl(*rhs)
3✔
2712
    }
2713
}
2714

2715
#[cfg(feature = "i32")]
2716

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

2725
#[cfg(feature = "i32")]
2726

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

2735
#[cfg(feature = "i32")]
2736

2737
impl Shr<IVec3> for U8Vec3 {
2738
    type Output = Self;
2739
    #[inline]
2740
    fn shr(self, rhs: IVec3) -> Self {
3✔
2741
        Self {
2742
            x: self.x.shr(rhs.x),
3✔
2743
            y: self.y.shr(rhs.y),
3✔
2744
            z: self.z.shr(rhs.z),
3✔
2745
        }
2746
    }
2747
}
2748

2749
#[cfg(feature = "i32")]
2750

2751
impl Shr<&IVec3> for U8Vec3 {
2752
    type Output = Self;
2753
    #[inline]
2754
    fn shr(self, rhs: &IVec3) -> Self {
3✔
2755
        self.shr(*rhs)
3✔
2756
    }
2757
}
2758

2759
#[cfg(feature = "i32")]
2760

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

2769
#[cfg(feature = "i32")]
2770

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

2779
#[cfg(feature = "u32")]
2780

2781
impl Shl<UVec3> for U8Vec3 {
2782
    type Output = Self;
2783
    #[inline]
2784
    fn shl(self, rhs: UVec3) -> Self {
3✔
2785
        Self {
2786
            x: self.x.shl(rhs.x),
3✔
2787
            y: self.y.shl(rhs.y),
3✔
2788
            z: self.z.shl(rhs.z),
3✔
2789
        }
2790
    }
2791
}
2792

2793
#[cfg(feature = "u32")]
2794

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

2803
#[cfg(feature = "u32")]
2804

2805
impl Shl<&UVec3> for &U8Vec3 {
2806
    type Output = U8Vec3;
2807
    #[inline]
2808
    fn shl(self, rhs: &UVec3) -> U8Vec3 {
3✔
2809
        (*self).shl(*rhs)
3✔
2810
    }
2811
}
2812

2813
#[cfg(feature = "u32")]
2814

2815
impl Shl<UVec3> for &U8Vec3 {
2816
    type Output = U8Vec3;
2817
    #[inline]
2818
    fn shl(self, rhs: UVec3) -> U8Vec3 {
3✔
2819
        (*self).shl(rhs)
3✔
2820
    }
2821
}
2822

2823
#[cfg(feature = "u32")]
2824

2825
impl Shr<UVec3> for U8Vec3 {
2826
    type Output = Self;
2827
    #[inline]
2828
    fn shr(self, rhs: UVec3) -> Self {
3✔
2829
        Self {
2830
            x: self.x.shr(rhs.x),
3✔
2831
            y: self.y.shr(rhs.y),
3✔
2832
            z: self.z.shr(rhs.z),
3✔
2833
        }
2834
    }
2835
}
2836

2837
#[cfg(feature = "u32")]
2838

2839
impl Shr<&UVec3> for U8Vec3 {
2840
    type Output = Self;
2841
    #[inline]
2842
    fn shr(self, rhs: &UVec3) -> Self {
3✔
2843
        self.shr(*rhs)
3✔
2844
    }
2845
}
2846

2847
#[cfg(feature = "u32")]
2848

2849
impl Shr<&UVec3> for &U8Vec3 {
2850
    type Output = U8Vec3;
2851
    #[inline]
2852
    fn shr(self, rhs: &UVec3) -> U8Vec3 {
3✔
2853
        (*self).shr(*rhs)
3✔
2854
    }
2855
}
2856

2857
#[cfg(feature = "u32")]
2858

2859
impl Shr<UVec3> for &U8Vec3 {
2860
    type Output = U8Vec3;
2861
    #[inline]
2862
    fn shr(self, rhs: UVec3) -> U8Vec3 {
3✔
2863
        (*self).shr(rhs)
3✔
2864
    }
2865
}
2866

2867
impl Index<usize> for U8Vec3 {
2868
    type Output = u8;
2869
    #[inline]
2870
    fn index(&self, index: usize) -> &Self::Output {
3✔
2871
        match index {
6✔
2872
            0 => &self.x,
3✔
2873
            1 => &self.y,
3✔
2874
            2 => &self.z,
3✔
2875
            _ => panic!("index out of bounds"),
×
2876
        }
2877
    }
2878
}
2879

2880
impl IndexMut<usize> for U8Vec3 {
2881
    #[inline]
2882
    fn index_mut(&mut self, index: usize) -> &mut Self::Output {
3✔
2883
        match index {
6✔
2884
            0 => &mut self.x,
3✔
2885
            1 => &mut self.y,
3✔
2886
            2 => &mut self.z,
3✔
2887
            _ => panic!("index out of bounds"),
×
2888
        }
2889
    }
2890
}
2891

2892
impl fmt::Display for U8Vec3 {
2893
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3✔
2894
        write!(f, "[{}, {}, {}]", self.x, self.y, self.z)
3✔
2895
    }
2896
}
2897

2898
impl fmt::Debug for U8Vec3 {
2899
    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
3✔
2900
        fmt.debug_tuple(stringify!(U8Vec3))
3✔
2901
            .field(&self.x)
3✔
2902
            .field(&self.y)
3✔
2903
            .field(&self.z)
3✔
2904
            .finish()
2905
    }
2906
}
2907

2908
impl From<[u8; 3]> for U8Vec3 {
2909
    #[inline]
2910
    fn from(a: [u8; 3]) -> Self {
6✔
2911
        Self::new(a[0], a[1], a[2])
12✔
2912
    }
2913
}
2914

2915
impl From<U8Vec3> for [u8; 3] {
2916
    #[inline]
2917
    fn from(v: U8Vec3) -> Self {
3✔
2918
        [v.x, v.y, v.z]
3✔
2919
    }
2920
}
2921

2922
impl From<(u8, u8, u8)> for U8Vec3 {
2923
    #[inline]
2924
    fn from(t: (u8, u8, u8)) -> Self {
3✔
2925
        Self::new(t.0, t.1, t.2)
6✔
2926
    }
2927
}
2928

2929
impl From<U8Vec3> for (u8, u8, u8) {
2930
    #[inline]
2931
    fn from(v: U8Vec3) -> Self {
6✔
2932
        (v.x, v.y, v.z)
6✔
2933
    }
2934
}
2935

2936
impl From<(U8Vec2, u8)> for U8Vec3 {
2937
    #[inline]
2938
    fn from((v, z): (U8Vec2, u8)) -> Self {
×
2939
        Self::new(v.x, v.y, z)
×
2940
    }
2941
}
2942

2943
#[cfg(feature = "i8")]
2944

2945
impl TryFrom<I8Vec3> for U8Vec3 {
2946
    type Error = core::num::TryFromIntError;
2947

2948
    #[inline]
2949
    fn try_from(v: I8Vec3) -> Result<Self, Self::Error> {
3✔
2950
        Ok(Self::new(
3✔
2951
            u8::try_from(v.x)?,
3✔
2952
            u8::try_from(v.y)?,
3✔
2953
            u8::try_from(v.z)?,
3✔
2954
        ))
2955
    }
2956
}
2957

2958
#[cfg(feature = "i16")]
2959

2960
impl TryFrom<I16Vec3> for U8Vec3 {
2961
    type Error = core::num::TryFromIntError;
2962

2963
    #[inline]
2964
    fn try_from(v: I16Vec3) -> Result<Self, Self::Error> {
3✔
2965
        Ok(Self::new(
3✔
2966
            u8::try_from(v.x)?,
3✔
2967
            u8::try_from(v.y)?,
3✔
2968
            u8::try_from(v.z)?,
3✔
2969
        ))
2970
    }
2971
}
2972

2973
#[cfg(feature = "u16")]
2974

2975
impl TryFrom<U16Vec3> for U8Vec3 {
2976
    type Error = core::num::TryFromIntError;
2977

2978
    #[inline]
2979
    fn try_from(v: U16Vec3) -> Result<Self, Self::Error> {
3✔
2980
        Ok(Self::new(
3✔
2981
            u8::try_from(v.x)?,
3✔
2982
            u8::try_from(v.y)?,
3✔
2983
            u8::try_from(v.z)?,
3✔
2984
        ))
2985
    }
2986
}
2987

2988
#[cfg(feature = "i32")]
2989

2990
impl TryFrom<IVec3> for U8Vec3 {
2991
    type Error = core::num::TryFromIntError;
2992

2993
    #[inline]
2994
    fn try_from(v: IVec3) -> Result<Self, Self::Error> {
3✔
2995
        Ok(Self::new(
3✔
2996
            u8::try_from(v.x)?,
3✔
2997
            u8::try_from(v.y)?,
3✔
2998
            u8::try_from(v.z)?,
3✔
2999
        ))
3000
    }
3001
}
3002

3003
#[cfg(feature = "u32")]
3004

3005
impl TryFrom<UVec3> for U8Vec3 {
3006
    type Error = core::num::TryFromIntError;
3007

3008
    #[inline]
3009
    fn try_from(v: UVec3) -> Result<Self, Self::Error> {
3✔
3010
        Ok(Self::new(
3✔
3011
            u8::try_from(v.x)?,
3✔
3012
            u8::try_from(v.y)?,
3✔
3013
            u8::try_from(v.z)?,
3✔
3014
        ))
3015
    }
3016
}
3017

3018
#[cfg(feature = "i64")]
3019

3020
impl TryFrom<I64Vec3> for U8Vec3 {
3021
    type Error = core::num::TryFromIntError;
3022

3023
    #[inline]
3024
    fn try_from(v: I64Vec3) -> Result<Self, Self::Error> {
3✔
3025
        Ok(Self::new(
3✔
3026
            u8::try_from(v.x)?,
3✔
3027
            u8::try_from(v.y)?,
3✔
3028
            u8::try_from(v.z)?,
3✔
3029
        ))
3030
    }
3031
}
3032

3033
#[cfg(feature = "u64")]
3034

3035
impl TryFrom<U64Vec3> for U8Vec3 {
3036
    type Error = core::num::TryFromIntError;
3037

3038
    #[inline]
3039
    fn try_from(v: U64Vec3) -> Result<Self, Self::Error> {
3✔
3040
        Ok(Self::new(
3✔
3041
            u8::try_from(v.x)?,
3✔
3042
            u8::try_from(v.y)?,
3✔
3043
            u8::try_from(v.z)?,
3✔
3044
        ))
3045
    }
3046
}
3047

3048
#[cfg(feature = "isize")]
3049

3050
impl TryFrom<ISizeVec3> for U8Vec3 {
3051
    type Error = core::num::TryFromIntError;
3052

3053
    #[inline]
3054
    fn try_from(v: ISizeVec3) -> Result<Self, Self::Error> {
3✔
3055
        Ok(Self::new(
3✔
3056
            u8::try_from(v.x)?,
3✔
3057
            u8::try_from(v.y)?,
3✔
3058
            u8::try_from(v.z)?,
3✔
3059
        ))
3060
    }
3061
}
3062

3063
#[cfg(feature = "usize")]
3064

3065
impl TryFrom<USizeVec3> for U8Vec3 {
3066
    type Error = core::num::TryFromIntError;
3067

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

3078
impl From<BVec3> for U8Vec3 {
3079
    #[inline]
3080
    fn from(v: BVec3) -> Self {
3✔
3081
        Self::new(u8::from(v.x), u8::from(v.y), u8::from(v.z))
6✔
3082
    }
3083
}
3084

3085
impl From<BVec3A> for U8Vec3 {
3086
    #[inline]
3087
    fn from(v: BVec3A) -> Self {
3✔
3088
        let bool_array: [bool; 3] = v.into();
3✔
3089
        Self::new(
3090
            u8::from(bool_array[0]),
3✔
3091
            u8::from(bool_array[1]),
3✔
3092
            u8::from(bool_array[2]),
3✔
3093
        )
3094
    }
3095
}
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