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

bitshifter / glam-rs / 13410700947

19 Feb 2025 10:43AM UTC coverage: 95.889% (+0.1%) from 95.765%
13410700947

push

github

web-flow
BVec test refactor (#611)

Makes it easier to test all combinations of BVec* types.

39983 of 41697 relevant lines covered (95.89%)

3.61 hits per line

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

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

3
use crate::{
4
    BVec3, BVec3A, I16Vec3, I64Vec3, I8Vec3, IVec3, U16Vec3, U64Vec3, U8Vec2, U8Vec4, UVec3,
5
};
6

7
use core::fmt;
8
use core::iter::{Product, Sum};
9
use core::{f32, ops::*};
10

11
/// Creates a 3-dimensional vector.
12
#[inline(always)]
13
#[must_use]
14
pub const fn u8vec3(x: u8, y: u8, z: u8) -> U8Vec3 {
6✔
15
    U8Vec3::new(x, y, z)
7✔
16
}
17

18
/// A 3-dimensional vector.
19
#[cfg_attr(not(target_arch = "spirv"), derive(Hash))]
20
#[derive(Clone, Copy, PartialEq, Eq)]
21
#[cfg_attr(not(target_arch = "spirv"), repr(C))]
22
#[cfg_attr(target_arch = "spirv", repr(simd))]
23
pub struct U8Vec3 {
24
    pub x: u8,
25
    pub y: u8,
26
    pub z: u8,
27
}
28

29
impl U8Vec3 {
30
    /// All zeroes.
31
    pub const ZERO: Self = Self::splat(0);
32

33
    /// All ones.
34
    pub const ONE: Self = Self::splat(1);
35

36
    /// All `u8::MIN`.
37
    pub const MIN: Self = Self::splat(u8::MIN);
38

39
    /// All `u8::MAX`.
40
    pub const MAX: Self = Self::splat(u8::MAX);
41

42
    /// A unit vector pointing along the positive X axis.
43
    pub const X: Self = Self::new(1, 0, 0);
44

45
    /// A unit vector pointing along the positive Y axis.
46
    pub const Y: Self = Self::new(0, 1, 0);
47

48
    /// A unit vector pointing along the positive Z axis.
49
    pub const Z: Self = Self::new(0, 0, 1);
50

51
    /// The unit axes.
52
    pub const AXES: [Self; 3] = [Self::X, Self::Y, Self::Z];
53

54
    /// Creates a new vector.
55
    #[inline(always)]
56
    #[must_use]
57
    pub const fn new(x: u8, y: u8, z: u8) -> Self {
15✔
58
        Self { x, y, z }
59
    }
60

61
    /// Creates a vector with all elements set to `v`.
62
    #[inline]
63
    #[must_use]
64
    pub const fn splat(v: u8) -> Self {
3✔
65
        Self { x: v, y: v, z: v }
66
    }
67

68
    /// Returns a vector containing each element of `self` modified by a mapping function `f`.
69
    #[inline]
70
    #[must_use]
71
    pub fn map<F>(self, f: F) -> Self
6✔
72
    where
73
        F: Fn(u8) -> u8,
74
    {
75
        Self::new(f(self.x), f(self.y), f(self.z))
12✔
76
    }
77

78
    /// Creates a vector from the elements in `if_true` and `if_false`, selecting which to use
79
    /// for each element of `self`.
80
    ///
81
    /// A true element in the mask uses the corresponding element from `if_true`, and false
82
    /// uses the element from `if_false`.
83
    #[inline]
84
    #[must_use]
85
    pub fn select(mask: BVec3, if_true: Self, if_false: Self) -> Self {
3✔
86
        Self {
87
            x: if mask.test(0) { if_true.x } else { if_false.x },
3✔
88
            y: if mask.test(1) { if_true.y } else { if_false.y },
3✔
89
            z: if mask.test(2) { if_true.z } else { if_false.z },
3✔
90
        }
91
    }
92

93
    /// Creates a new vector from an array.
94
    #[inline]
95
    #[must_use]
96
    pub const fn from_array(a: [u8; 3]) -> Self {
×
97
        Self::new(a[0], a[1], a[2])
×
98
    }
99

100
    /// `[x, y, z]`
101
    #[inline]
102
    #[must_use]
103
    pub const fn to_array(&self) -> [u8; 3] {
3✔
104
        [self.x, self.y, self.z]
3✔
105
    }
106

107
    /// Creates a vector from the first 3 values in `slice`.
108
    ///
109
    /// # Panics
110
    ///
111
    /// Panics if `slice` is less than 3 elements long.
112
    #[inline]
113
    #[must_use]
114
    pub const fn from_slice(slice: &[u8]) -> Self {
3✔
115
        assert!(slice.len() >= 3);
3✔
116
        Self::new(slice[0], slice[1], slice[2])
6✔
117
    }
118

119
    /// Writes the elements of `self` to the first 3 elements in `slice`.
120
    ///
121
    /// # Panics
122
    ///
123
    /// Panics if `slice` is less than 3 elements long.
124
    #[inline]
125
    pub fn write_to_slice(self, slice: &mut [u8]) {
3✔
126
        slice[..3].copy_from_slice(&self.to_array());
3✔
127
    }
128

129
    /// Internal method for creating a 3D vector from a 4D vector, discarding `w`.
130
    #[allow(dead_code)]
131
    #[inline]
132
    #[must_use]
133
    pub(crate) fn from_vec4(v: U8Vec4) -> Self {
×
134
        Self {
135
            x: v.x,
×
136
            y: v.y,
×
137
            z: v.z,
×
138
        }
139
    }
140

141
    /// Creates a 4D vector from `self` and the given `w` value.
142
    #[inline]
143
    #[must_use]
144
    pub fn extend(self, w: u8) -> U8Vec4 {
3✔
145
        U8Vec4::new(self.x, self.y, self.z, w)
3✔
146
    }
147

148
    /// Creates a 2D vector from the `x` and `y` elements of `self`, discarding `z`.
149
    ///
150
    /// Truncation may also be performed by using [`self.xy()`][crate::swizzles::Vec3Swizzles::xy()].
151
    #[inline]
152
    #[must_use]
153
    pub fn truncate(self) -> U8Vec2 {
×
154
        use crate::swizzles::Vec3Swizzles;
155
        self.xy()
×
156
    }
157

158
    /// Creates a 3D vector from `self` with the given value of `x`.
159
    #[inline]
160
    #[must_use]
161
    pub fn with_x(mut self, x: u8) -> Self {
3✔
162
        self.x = x;
3✔
163
        self
3✔
164
    }
165

166
    /// Creates a 3D vector from `self` with the given value of `y`.
167
    #[inline]
168
    #[must_use]
169
    pub fn with_y(mut self, y: u8) -> Self {
3✔
170
        self.y = y;
3✔
171
        self
3✔
172
    }
173

174
    /// Creates a 3D vector from `self` with the given value of `z`.
175
    #[inline]
176
    #[must_use]
177
    pub fn with_z(mut self, z: u8) -> Self {
3✔
178
        self.z = z;
3✔
179
        self
3✔
180
    }
181

182
    /// Computes the dot product of `self` and `rhs`.
183
    #[inline]
184
    #[must_use]
185
    pub fn dot(self, rhs: Self) -> u8 {
3✔
186
        (self.x * rhs.x) + (self.y * rhs.y) + (self.z * rhs.z)
3✔
187
    }
188

189
    /// Returns a vector where every component is the dot product of `self` and `rhs`.
190
    #[inline]
191
    #[must_use]
192
    pub fn dot_into_vec(self, rhs: Self) -> Self {
3✔
193
        Self::splat(self.dot(rhs))
3✔
194
    }
195

196
    /// Computes the cross product of `self` and `rhs`.
197
    #[inline]
198
    #[must_use]
199
    pub fn cross(self, rhs: Self) -> Self {
3✔
200
        Self {
201
            x: self.y * rhs.z - rhs.y * self.z,
3✔
202
            y: self.z * rhs.x - rhs.z * self.x,
6✔
203
            z: self.x * rhs.y - rhs.x * self.y,
6✔
204
        }
205
    }
206

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

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

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

247
    /// Returns the horizontal minimum of `self`.
248
    ///
249
    /// In other words this computes `min(x, y, ..)`.
250
    #[inline]
251
    #[must_use]
252
    pub fn min_element(self) -> u8 {
6✔
253
        self.x.min(self.y.min(self.z))
6✔
254
    }
255

256
    /// Returns the horizontal maximum of `self`.
257
    ///
258
    /// In other words this computes `max(x, y, ..)`.
259
    #[inline]
260
    #[must_use]
261
    pub fn max_element(self) -> u8 {
6✔
262
        self.x.max(self.y.max(self.z))
6✔
263
    }
264

265
    /// Returns the sum of all elements of `self`.
266
    ///
267
    /// In other words, this computes `self.x + self.y + ..`.
268
    #[inline]
269
    #[must_use]
270
    pub fn element_sum(self) -> u8 {
3✔
271
        self.x + self.y + self.z
3✔
272
    }
273

274
    /// Returns the product of all elements of `self`.
275
    ///
276
    /// In other words, this computes `self.x * self.y * ..`.
277
    #[inline]
278
    #[must_use]
279
    pub fn element_product(self) -> u8 {
3✔
280
        self.x * self.y * self.z
3✔
281
    }
282

283
    /// Returns a vector mask containing the result of a `==` comparison for each element of
284
    /// `self` and `rhs`.
285
    ///
286
    /// In other words, this computes `[self.x == rhs.x, self.y == rhs.y, ..]` for all
287
    /// elements.
288
    #[inline]
289
    #[must_use]
290
    pub fn cmpeq(self, rhs: Self) -> BVec3 {
3✔
291
        BVec3::new(self.x.eq(&rhs.x), self.y.eq(&rhs.y), self.z.eq(&rhs.z))
3✔
292
    }
293

294
    /// Returns a vector mask containing the result of a `!=` comparison for each element of
295
    /// `self` and `rhs`.
296
    ///
297
    /// In other words this computes `[self.x != rhs.x, self.y != rhs.y, ..]` for all
298
    /// elements.
299
    #[inline]
300
    #[must_use]
301
    pub fn cmpne(self, rhs: Self) -> BVec3 {
3✔
302
        BVec3::new(self.x.ne(&rhs.x), self.y.ne(&rhs.y), self.z.ne(&rhs.z))
3✔
303
    }
304

305
    /// Returns a vector mask containing the result of a `>=` comparison for each element of
306
    /// `self` and `rhs`.
307
    ///
308
    /// In other words this computes `[self.x >= rhs.x, self.y >= rhs.y, ..]` for all
309
    /// elements.
310
    #[inline]
311
    #[must_use]
312
    pub fn cmpge(self, rhs: Self) -> BVec3 {
3✔
313
        BVec3::new(self.x.ge(&rhs.x), self.y.ge(&rhs.y), self.z.ge(&rhs.z))
3✔
314
    }
315

316
    /// Returns a vector mask containing the result of a `>` comparison for each element of
317
    /// `self` and `rhs`.
318
    ///
319
    /// In other words this computes `[self.x > rhs.x, self.y > rhs.y, ..]` for all
320
    /// elements.
321
    #[inline]
322
    #[must_use]
323
    pub fn cmpgt(self, rhs: Self) -> BVec3 {
3✔
324
        BVec3::new(self.x.gt(&rhs.x), self.y.gt(&rhs.y), self.z.gt(&rhs.z))
3✔
325
    }
326

327
    /// Returns a vector mask containing the result of a `<=` comparison for each element of
328
    /// `self` and `rhs`.
329
    ///
330
    /// In other words this computes `[self.x <= rhs.x, self.y <= rhs.y, ..]` for all
331
    /// elements.
332
    #[inline]
333
    #[must_use]
334
    pub fn cmple(self, rhs: Self) -> BVec3 {
3✔
335
        BVec3::new(self.x.le(&rhs.x), self.y.le(&rhs.y), self.z.le(&rhs.z))
3✔
336
    }
337

338
    /// Returns a vector mask containing the result of a `<` comparison for each element of
339
    /// `self` and `rhs`.
340
    ///
341
    /// In other words this computes `[self.x < rhs.x, self.y < rhs.y, ..]` for all
342
    /// elements.
343
    #[inline]
344
    #[must_use]
345
    pub fn cmplt(self, rhs: Self) -> BVec3 {
3✔
346
        BVec3::new(self.x.lt(&rhs.x), self.y.lt(&rhs.y), self.z.lt(&rhs.z))
3✔
347
    }
348

349
    /// Computes the squared length of `self`.
350
    #[doc(alias = "magnitude2")]
351
    #[inline]
352
    #[must_use]
353
    pub fn length_squared(self) -> u8 {
3✔
354
        self.dot(self)
3✔
355
    }
356

357
    /// Computes the [manhattan distance] between two points.
358
    ///
359
    /// # Overflow
360
    /// This method may overflow if the result is greater than [`u8::MAX`].
361
    ///
362
    /// See also [`checked_manhattan_distance`][U8Vec3::checked_manhattan_distance].
363
    ///
364
    /// [manhattan distance]: https://en.wikipedia.org/wiki/Taxicab_geometry
365
    #[inline]
366
    #[must_use]
367
    pub fn manhattan_distance(self, other: Self) -> u8 {
3✔
368
        self.x.abs_diff(other.x) + self.y.abs_diff(other.y) + self.z.abs_diff(other.z)
3✔
369
    }
370

371
    /// Computes the [manhattan distance] between two points.
372
    ///
373
    /// This will returns [`None`] if the result is greater than [`u8::MAX`].
374
    ///
375
    /// [manhattan distance]: https://en.wikipedia.org/wiki/Taxicab_geometry
376
    #[inline]
377
    #[must_use]
378
    pub fn checked_manhattan_distance(self, other: Self) -> Option<u8> {
3✔
379
        let d = self.x.abs_diff(other.x);
3✔
380
        let d = d.checked_add(self.y.abs_diff(other.y))?;
6✔
381
        d.checked_add(self.z.abs_diff(other.z))
3✔
382
    }
383

384
    /// Computes the [chebyshev distance] between two points.
385
    ///
386
    /// [chebyshev distance]: https://en.wikipedia.org/wiki/Chebyshev_distance
387
    #[inline]
388
    #[must_use]
389
    pub fn chebyshev_distance(self, other: Self) -> u8 {
3✔
390
        // Note: the compiler will eventually optimize out the loop
391
        [
392
            self.x.abs_diff(other.x),
3✔
393
            self.y.abs_diff(other.y),
3✔
394
            self.z.abs_diff(other.z),
3✔
395
        ]
396
        .into_iter()
397
        .max()
398
        .unwrap()
399
    }
400

401
    /// Casts all elements of `self` to `f32`.
402
    #[inline]
403
    #[must_use]
404
    pub fn as_vec3(&self) -> crate::Vec3 {
3✔
405
        crate::Vec3::new(self.x as f32, self.y as f32, self.z as f32)
3✔
406
    }
407

408
    /// Casts all elements of `self` to `f32`.
409
    #[inline]
410
    #[must_use]
411
    pub fn as_vec3a(&self) -> crate::Vec3A {
3✔
412
        crate::Vec3A::new(self.x as f32, self.y as f32, self.z as f32)
3✔
413
    }
414

415
    /// Casts all elements of `self` to `f64`.
416
    #[inline]
417
    #[must_use]
418
    pub fn as_dvec3(&self) -> crate::DVec3 {
3✔
419
        crate::DVec3::new(self.x as f64, self.y as f64, self.z as f64)
3✔
420
    }
421

422
    /// Casts all elements of `self` to `i8`.
423
    #[inline]
424
    #[must_use]
425
    pub fn as_i8vec3(&self) -> crate::I8Vec3 {
3✔
426
        crate::I8Vec3::new(self.x as i8, self.y as i8, self.z as i8)
3✔
427
    }
428

429
    /// Casts all elements of `self` to `i16`.
430
    #[inline]
431
    #[must_use]
432
    pub fn as_i16vec3(&self) -> crate::I16Vec3 {
3✔
433
        crate::I16Vec3::new(self.x as i16, self.y as i16, self.z as i16)
3✔
434
    }
435

436
    /// Casts all elements of `self` to `u16`.
437
    #[inline]
438
    #[must_use]
439
    pub fn as_u16vec3(&self) -> crate::U16Vec3 {
3✔
440
        crate::U16Vec3::new(self.x as u16, self.y as u16, self.z as u16)
3✔
441
    }
442

443
    /// Casts all elements of `self` to `i32`.
444
    #[inline]
445
    #[must_use]
446
    pub fn as_ivec3(&self) -> crate::IVec3 {
3✔
447
        crate::IVec3::new(self.x as i32, self.y as i32, self.z as i32)
3✔
448
    }
449

450
    /// Casts all elements of `self` to `u32`.
451
    #[inline]
452
    #[must_use]
453
    pub fn as_uvec3(&self) -> crate::UVec3 {
3✔
454
        crate::UVec3::new(self.x as u32, self.y as u32, self.z as u32)
3✔
455
    }
456

457
    /// Casts all elements of `self` to `i64`.
458
    #[inline]
459
    #[must_use]
460
    pub fn as_i64vec3(&self) -> crate::I64Vec3 {
3✔
461
        crate::I64Vec3::new(self.x as i64, self.y as i64, self.z as i64)
3✔
462
    }
463

464
    /// Casts all elements of `self` to `u64`.
465
    #[inline]
466
    #[must_use]
467
    pub fn as_u64vec3(&self) -> crate::U64Vec3 {
3✔
468
        crate::U64Vec3::new(self.x as u64, self.y as u64, self.z as u64)
3✔
469
    }
470

471
    /// Returns a vector containing the wrapping addition of `self` and `rhs`.
472
    ///
473
    /// In other words this computes `Some([self.x + rhs.x, self.y + rhs.y, ..])` but returns `None` on any overflow.
474
    #[inline]
475
    #[must_use]
476
    pub const fn checked_add(self, rhs: Self) -> Option<Self> {
3✔
477
        let x = match self.x.checked_add(rhs.x) {
3✔
478
            Some(v) => v,
3✔
479
            None => return None,
3✔
480
        };
481
        let y = match self.y.checked_add(rhs.y) {
3✔
482
            Some(v) => v,
3✔
483
            None => return None,
3✔
484
        };
485
        let z = match self.z.checked_add(rhs.z) {
3✔
486
            Some(v) => v,
3✔
487
            None => return None,
3✔
488
        };
489

490
        Some(Self { x, y, z })
3✔
491
    }
492

493
    /// Returns a vector containing the wrapping subtraction of `self` and `rhs`.
494
    ///
495
    /// In other words this computes `Some([self.x - rhs.x, self.y - rhs.y, ..])` but returns `None` on any overflow.
496
    #[inline]
497
    #[must_use]
498
    pub const fn checked_sub(self, rhs: Self) -> Option<Self> {
3✔
499
        let x = match self.x.checked_sub(rhs.x) {
3✔
500
            Some(v) => v,
3✔
501
            None => return None,
3✔
502
        };
503
        let y = match self.y.checked_sub(rhs.y) {
3✔
504
            Some(v) => v,
3✔
505
            None => return None,
3✔
506
        };
507
        let z = match self.z.checked_sub(rhs.z) {
3✔
508
            Some(v) => v,
3✔
509
            None => return None,
3✔
510
        };
511

512
        Some(Self { x, y, z })
3✔
513
    }
514

515
    /// Returns a vector containing the wrapping multiplication of `self` and `rhs`.
516
    ///
517
    /// In other words this computes `Some([self.x * rhs.x, self.y * rhs.y, ..])` but returns `None` on any overflow.
518
    #[inline]
519
    #[must_use]
520
    pub const fn checked_mul(self, rhs: Self) -> Option<Self> {
3✔
521
        let x = match self.x.checked_mul(rhs.x) {
3✔
522
            Some(v) => v,
3✔
523
            None => return None,
3✔
524
        };
525
        let y = match self.y.checked_mul(rhs.y) {
3✔
526
            Some(v) => v,
3✔
527
            None => return None,
×
528
        };
529
        let z = match self.z.checked_mul(rhs.z) {
3✔
530
            Some(v) => v,
3✔
531
            None => return None,
×
532
        };
533

534
        Some(Self { x, y, z })
3✔
535
    }
536

537
    /// Returns a vector containing the wrapping division of `self` and `rhs`.
538
    ///
539
    /// In other words this computes `Some([self.x / rhs.x, self.y / rhs.y, ..])` but returns `None` on any division by zero.
540
    #[inline]
541
    #[must_use]
542
    pub const fn checked_div(self, rhs: Self) -> Option<Self> {
3✔
543
        let x = match self.x.checked_div(rhs.x) {
3✔
544
            Some(v) => v,
3✔
545
            None => return None,
3✔
546
        };
547
        let y = match self.y.checked_div(rhs.y) {
3✔
548
            Some(v) => v,
3✔
549
            None => return None,
3✔
550
        };
551
        let z = match self.z.checked_div(rhs.z) {
3✔
552
            Some(v) => v,
3✔
553
            None => return None,
×
554
        };
555

556
        Some(Self { x, y, z })
3✔
557
    }
558

559
    /// Returns a vector containing the wrapping addition of `self` and `rhs`.
560
    ///
561
    /// In other words this computes `[self.x.wrapping_add(rhs.x), self.y.wrapping_add(rhs.y), ..]`.
562
    #[inline]
563
    #[must_use]
564
    pub const fn wrapping_add(self, rhs: Self) -> Self {
3✔
565
        Self {
566
            x: self.x.wrapping_add(rhs.x),
3✔
567
            y: self.y.wrapping_add(rhs.y),
3✔
568
            z: self.z.wrapping_add(rhs.z),
3✔
569
        }
570
    }
571

572
    /// Returns a vector containing the wrapping subtraction of `self` and `rhs`.
573
    ///
574
    /// In other words this computes `[self.x.wrapping_sub(rhs.x), self.y.wrapping_sub(rhs.y), ..]`.
575
    #[inline]
576
    #[must_use]
577
    pub const fn wrapping_sub(self, rhs: Self) -> Self {
3✔
578
        Self {
579
            x: self.x.wrapping_sub(rhs.x),
3✔
580
            y: self.y.wrapping_sub(rhs.y),
3✔
581
            z: self.z.wrapping_sub(rhs.z),
3✔
582
        }
583
    }
584

585
    /// Returns a vector containing the wrapping multiplication of `self` and `rhs`.
586
    ///
587
    /// In other words this computes `[self.x.wrapping_mul(rhs.x), self.y.wrapping_mul(rhs.y), ..]`.
588
    #[inline]
589
    #[must_use]
590
    pub const fn wrapping_mul(self, rhs: Self) -> Self {
3✔
591
        Self {
592
            x: self.x.wrapping_mul(rhs.x),
3✔
593
            y: self.y.wrapping_mul(rhs.y),
3✔
594
            z: self.z.wrapping_mul(rhs.z),
3✔
595
        }
596
    }
597

598
    /// Returns a vector containing the wrapping division of `self` and `rhs`.
599
    ///
600
    /// In other words this computes `[self.x.wrapping_div(rhs.x), self.y.wrapping_div(rhs.y), ..]`.
601
    #[inline]
602
    #[must_use]
603
    pub const fn wrapping_div(self, rhs: Self) -> Self {
3✔
604
        Self {
605
            x: self.x.wrapping_div(rhs.x),
3✔
606
            y: self.y.wrapping_div(rhs.y),
3✔
607
            z: self.z.wrapping_div(rhs.z),
3✔
608
        }
609
    }
610

611
    /// Returns a vector containing the saturating addition of `self` and `rhs`.
612
    ///
613
    /// In other words this computes `[self.x.saturating_add(rhs.x), self.y.saturating_add(rhs.y), ..]`.
614
    #[inline]
615
    #[must_use]
616
    pub const fn saturating_add(self, rhs: Self) -> Self {
3✔
617
        Self {
618
            x: self.x.saturating_add(rhs.x),
3✔
619
            y: self.y.saturating_add(rhs.y),
3✔
620
            z: self.z.saturating_add(rhs.z),
3✔
621
        }
622
    }
623

624
    /// Returns a vector containing the saturating subtraction of `self` and `rhs`.
625
    ///
626
    /// In other words this computes `[self.x.saturating_sub(rhs.x), self.y.saturating_sub(rhs.y), ..]`.
627
    #[inline]
628
    #[must_use]
629
    pub const fn saturating_sub(self, rhs: Self) -> Self {
3✔
630
        Self {
631
            x: self.x.saturating_sub(rhs.x),
3✔
632
            y: self.y.saturating_sub(rhs.y),
3✔
633
            z: self.z.saturating_sub(rhs.z),
3✔
634
        }
635
    }
636

637
    /// Returns a vector containing the saturating multiplication of `self` and `rhs`.
638
    ///
639
    /// In other words this computes `[self.x.saturating_mul(rhs.x), self.y.saturating_mul(rhs.y), ..]`.
640
    #[inline]
641
    #[must_use]
642
    pub const fn saturating_mul(self, rhs: Self) -> Self {
3✔
643
        Self {
644
            x: self.x.saturating_mul(rhs.x),
3✔
645
            y: self.y.saturating_mul(rhs.y),
3✔
646
            z: self.z.saturating_mul(rhs.z),
3✔
647
        }
648
    }
649

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

663
    /// Returns a vector containing the wrapping addition of `self` and signed vector `rhs`.
664
    ///
665
    /// In other words this computes `Some([self.x + rhs.x, self.y + rhs.y, ..])` but returns `None` on any overflow.
666
    #[inline]
667
    #[must_use]
668
    pub const fn checked_add_signed(self, rhs: I8Vec3) -> Option<Self> {
×
669
        let x = match self.x.checked_add_signed(rhs.x) {
×
670
            Some(v) => v,
×
671
            None => return None,
×
672
        };
673
        let y = match self.y.checked_add_signed(rhs.y) {
×
674
            Some(v) => v,
×
675
            None => return None,
×
676
        };
677
        let z = match self.z.checked_add_signed(rhs.z) {
×
678
            Some(v) => v,
×
679
            None => return None,
×
680
        };
681

682
        Some(Self { x, y, z })
×
683
    }
684

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

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

712
impl Default for U8Vec3 {
713
    #[inline(always)]
714
    fn default() -> Self {
×
715
        Self::ZERO
6✔
716
    }
717
}
718

719
impl Div<U8Vec3> for U8Vec3 {
720
    type Output = Self;
721
    #[inline]
722
    fn div(self, rhs: Self) -> Self {
3✔
723
        Self {
724
            x: self.x.div(rhs.x),
3✔
725
            y: self.y.div(rhs.y),
3✔
726
            z: self.z.div(rhs.z),
3✔
727
        }
728
    }
729
}
730

731
impl Div<&U8Vec3> for U8Vec3 {
732
    type Output = U8Vec3;
733
    #[inline]
734
    fn div(self, rhs: &U8Vec3) -> U8Vec3 {
3✔
735
        self.div(*rhs)
3✔
736
    }
737
}
738

739
impl Div<&U8Vec3> for &U8Vec3 {
740
    type Output = U8Vec3;
741
    #[inline]
742
    fn div(self, rhs: &U8Vec3) -> U8Vec3 {
3✔
743
        (*self).div(*rhs)
3✔
744
    }
745
}
746

747
impl Div<U8Vec3> for &U8Vec3 {
748
    type Output = U8Vec3;
749
    #[inline]
750
    fn div(self, rhs: U8Vec3) -> U8Vec3 {
3✔
751
        (*self).div(rhs)
3✔
752
    }
753
}
754

755
impl DivAssign<U8Vec3> for U8Vec3 {
756
    #[inline]
757
    fn div_assign(&mut self, rhs: Self) {
3✔
758
        self.x.div_assign(rhs.x);
3✔
759
        self.y.div_assign(rhs.y);
3✔
760
        self.z.div_assign(rhs.z);
3✔
761
    }
762
}
763

764
impl DivAssign<&U8Vec3> for U8Vec3 {
765
    #[inline]
766
    fn div_assign(&mut self, rhs: &U8Vec3) {
3✔
767
        self.div_assign(*rhs)
3✔
768
    }
769
}
770

771
impl Div<u8> for U8Vec3 {
772
    type Output = Self;
773
    #[inline]
774
    fn div(self, rhs: u8) -> Self {
6✔
775
        Self {
776
            x: self.x.div(rhs),
6✔
777
            y: self.y.div(rhs),
6✔
778
            z: self.z.div(rhs),
6✔
779
        }
780
    }
781
}
782

783
impl Div<&u8> for U8Vec3 {
784
    type Output = U8Vec3;
785
    #[inline]
786
    fn div(self, rhs: &u8) -> U8Vec3 {
3✔
787
        self.div(*rhs)
3✔
788
    }
789
}
790

791
impl Div<&u8> for &U8Vec3 {
792
    type Output = U8Vec3;
793
    #[inline]
794
    fn div(self, rhs: &u8) -> U8Vec3 {
3✔
795
        (*self).div(*rhs)
3✔
796
    }
797
}
798

799
impl Div<u8> for &U8Vec3 {
800
    type Output = U8Vec3;
801
    #[inline]
802
    fn div(self, rhs: u8) -> U8Vec3 {
3✔
803
        (*self).div(rhs)
3✔
804
    }
805
}
806

807
impl DivAssign<u8> for U8Vec3 {
808
    #[inline]
809
    fn div_assign(&mut self, rhs: u8) {
3✔
810
        self.x.div_assign(rhs);
3✔
811
        self.y.div_assign(rhs);
3✔
812
        self.z.div_assign(rhs);
3✔
813
    }
814
}
815

816
impl DivAssign<&u8> for U8Vec3 {
817
    #[inline]
818
    fn div_assign(&mut self, rhs: &u8) {
3✔
819
        self.div_assign(*rhs)
3✔
820
    }
821
}
822

823
impl Div<U8Vec3> for u8 {
824
    type Output = U8Vec3;
825
    #[inline]
826
    fn div(self, rhs: U8Vec3) -> U8Vec3 {
3✔
827
        U8Vec3 {
828
            x: self.div(rhs.x),
3✔
829
            y: self.div(rhs.y),
3✔
830
            z: self.div(rhs.z),
3✔
831
        }
832
    }
833
}
834

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

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

851
impl Div<U8Vec3> for &u8 {
852
    type Output = U8Vec3;
853
    #[inline]
854
    fn div(self, rhs: U8Vec3) -> U8Vec3 {
3✔
855
        (*self).div(rhs)
3✔
856
    }
857
}
858

859
impl Mul<U8Vec3> for U8Vec3 {
860
    type Output = Self;
861
    #[inline]
862
    fn mul(self, rhs: Self) -> Self {
3✔
863
        Self {
864
            x: self.x.mul(rhs.x),
3✔
865
            y: self.y.mul(rhs.y),
3✔
866
            z: self.z.mul(rhs.z),
3✔
867
        }
868
    }
869
}
870

871
impl Mul<&U8Vec3> for U8Vec3 {
872
    type Output = U8Vec3;
873
    #[inline]
874
    fn mul(self, rhs: &U8Vec3) -> U8Vec3 {
3✔
875
        self.mul(*rhs)
3✔
876
    }
877
}
878

879
impl Mul<&U8Vec3> for &U8Vec3 {
880
    type Output = U8Vec3;
881
    #[inline]
882
    fn mul(self, rhs: &U8Vec3) -> U8Vec3 {
3✔
883
        (*self).mul(*rhs)
3✔
884
    }
885
}
886

887
impl Mul<U8Vec3> for &U8Vec3 {
888
    type Output = U8Vec3;
889
    #[inline]
890
    fn mul(self, rhs: U8Vec3) -> U8Vec3 {
3✔
891
        (*self).mul(rhs)
3✔
892
    }
893
}
894

895
impl MulAssign<U8Vec3> for U8Vec3 {
896
    #[inline]
897
    fn mul_assign(&mut self, rhs: Self) {
3✔
898
        self.x.mul_assign(rhs.x);
3✔
899
        self.y.mul_assign(rhs.y);
3✔
900
        self.z.mul_assign(rhs.z);
3✔
901
    }
902
}
903

904
impl MulAssign<&U8Vec3> for U8Vec3 {
905
    #[inline]
906
    fn mul_assign(&mut self, rhs: &U8Vec3) {
3✔
907
        self.mul_assign(*rhs)
3✔
908
    }
909
}
910

911
impl Mul<u8> for U8Vec3 {
912
    type Output = Self;
913
    #[inline]
914
    fn mul(self, rhs: u8) -> Self {
3✔
915
        Self {
916
            x: self.x.mul(rhs),
3✔
917
            y: self.y.mul(rhs),
3✔
918
            z: self.z.mul(rhs),
3✔
919
        }
920
    }
921
}
922

923
impl Mul<&u8> for U8Vec3 {
924
    type Output = U8Vec3;
925
    #[inline]
926
    fn mul(self, rhs: &u8) -> U8Vec3 {
3✔
927
        self.mul(*rhs)
3✔
928
    }
929
}
930

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

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

947
impl MulAssign<u8> for U8Vec3 {
948
    #[inline]
949
    fn mul_assign(&mut self, rhs: u8) {
3✔
950
        self.x.mul_assign(rhs);
3✔
951
        self.y.mul_assign(rhs);
3✔
952
        self.z.mul_assign(rhs);
3✔
953
    }
954
}
955

956
impl MulAssign<&u8> for U8Vec3 {
957
    #[inline]
958
    fn mul_assign(&mut self, rhs: &u8) {
3✔
959
        self.mul_assign(*rhs)
3✔
960
    }
961
}
962

963
impl Mul<U8Vec3> for u8 {
964
    type Output = U8Vec3;
965
    #[inline]
966
    fn mul(self, rhs: U8Vec3) -> U8Vec3 {
3✔
967
        U8Vec3 {
968
            x: self.mul(rhs.x),
3✔
969
            y: self.mul(rhs.y),
3✔
970
            z: self.mul(rhs.z),
3✔
971
        }
972
    }
973
}
974

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

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

991
impl Mul<U8Vec3> for &u8 {
992
    type Output = U8Vec3;
993
    #[inline]
994
    fn mul(self, rhs: U8Vec3) -> U8Vec3 {
3✔
995
        (*self).mul(rhs)
3✔
996
    }
997
}
998

999
impl Add<U8Vec3> for U8Vec3 {
1000
    type Output = Self;
1001
    #[inline]
1002
    fn add(self, rhs: Self) -> Self {
3✔
1003
        Self {
1004
            x: self.x.add(rhs.x),
5✔
1005
            y: self.y.add(rhs.y),
5✔
1006
            z: self.z.add(rhs.z),
5✔
1007
        }
1008
    }
1009
}
1010

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

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

1027
impl Add<U8Vec3> for &U8Vec3 {
1028
    type Output = U8Vec3;
1029
    #[inline]
1030
    fn add(self, rhs: U8Vec3) -> U8Vec3 {
3✔
1031
        (*self).add(rhs)
3✔
1032
    }
1033
}
1034

1035
impl AddAssign<U8Vec3> for U8Vec3 {
1036
    #[inline]
1037
    fn add_assign(&mut self, rhs: Self) {
3✔
1038
        self.x.add_assign(rhs.x);
3✔
1039
        self.y.add_assign(rhs.y);
3✔
1040
        self.z.add_assign(rhs.z);
3✔
1041
    }
1042
}
1043

1044
impl AddAssign<&U8Vec3> for U8Vec3 {
1045
    #[inline]
1046
    fn add_assign(&mut self, rhs: &U8Vec3) {
3✔
1047
        self.add_assign(*rhs)
3✔
1048
    }
1049
}
1050

1051
impl Add<u8> for U8Vec3 {
1052
    type Output = Self;
1053
    #[inline]
1054
    fn add(self, rhs: u8) -> Self {
3✔
1055
        Self {
1056
            x: self.x.add(rhs),
3✔
1057
            y: self.y.add(rhs),
3✔
1058
            z: self.z.add(rhs),
3✔
1059
        }
1060
    }
1061
}
1062

1063
impl Add<&u8> for U8Vec3 {
1064
    type Output = U8Vec3;
1065
    #[inline]
1066
    fn add(self, rhs: &u8) -> U8Vec3 {
3✔
1067
        self.add(*rhs)
3✔
1068
    }
1069
}
1070

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

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

1087
impl AddAssign<u8> for U8Vec3 {
1088
    #[inline]
1089
    fn add_assign(&mut self, rhs: u8) {
3✔
1090
        self.x.add_assign(rhs);
3✔
1091
        self.y.add_assign(rhs);
4✔
1092
        self.z.add_assign(rhs);
4✔
1093
    }
1094
}
1095

1096
impl AddAssign<&u8> for U8Vec3 {
1097
    #[inline]
1098
    fn add_assign(&mut self, rhs: &u8) {
3✔
1099
        self.add_assign(*rhs)
3✔
1100
    }
1101
}
1102

1103
impl Add<U8Vec3> for u8 {
1104
    type Output = U8Vec3;
1105
    #[inline]
1106
    fn add(self, rhs: U8Vec3) -> U8Vec3 {
3✔
1107
        U8Vec3 {
1108
            x: self.add(rhs.x),
3✔
1109
            y: self.add(rhs.y),
3✔
1110
            z: self.add(rhs.z),
3✔
1111
        }
1112
    }
1113
}
1114

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

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

1131
impl Add<U8Vec3> for &u8 {
1132
    type Output = U8Vec3;
1133
    #[inline]
1134
    fn add(self, rhs: U8Vec3) -> U8Vec3 {
3✔
1135
        (*self).add(rhs)
3✔
1136
    }
1137
}
1138

1139
impl Sub<U8Vec3> for U8Vec3 {
1140
    type Output = Self;
1141
    #[inline]
1142
    fn sub(self, rhs: Self) -> Self {
3✔
1143
        Self {
1144
            x: self.x.sub(rhs.x),
3✔
1145
            y: self.y.sub(rhs.y),
3✔
1146
            z: self.z.sub(rhs.z),
3✔
1147
        }
1148
    }
1149
}
1150

1151
impl Sub<&U8Vec3> for U8Vec3 {
1152
    type Output = U8Vec3;
1153
    #[inline]
1154
    fn sub(self, rhs: &U8Vec3) -> U8Vec3 {
3✔
1155
        self.sub(*rhs)
3✔
1156
    }
1157
}
1158

1159
impl Sub<&U8Vec3> for &U8Vec3 {
1160
    type Output = U8Vec3;
1161
    #[inline]
1162
    fn sub(self, rhs: &U8Vec3) -> U8Vec3 {
3✔
1163
        (*self).sub(*rhs)
3✔
1164
    }
1165
}
1166

1167
impl Sub<U8Vec3> for &U8Vec3 {
1168
    type Output = U8Vec3;
1169
    #[inline]
1170
    fn sub(self, rhs: U8Vec3) -> U8Vec3 {
3✔
1171
        (*self).sub(rhs)
3✔
1172
    }
1173
}
1174

1175
impl SubAssign<U8Vec3> for U8Vec3 {
1176
    #[inline]
1177
    fn sub_assign(&mut self, rhs: U8Vec3) {
3✔
1178
        self.x.sub_assign(rhs.x);
3✔
1179
        self.y.sub_assign(rhs.y);
3✔
1180
        self.z.sub_assign(rhs.z);
3✔
1181
    }
1182
}
1183

1184
impl SubAssign<&U8Vec3> for U8Vec3 {
1185
    #[inline]
1186
    fn sub_assign(&mut self, rhs: &U8Vec3) {
3✔
1187
        self.sub_assign(*rhs)
3✔
1188
    }
1189
}
1190

1191
impl Sub<u8> for U8Vec3 {
1192
    type Output = Self;
1193
    #[inline]
1194
    fn sub(self, rhs: u8) -> Self {
3✔
1195
        Self {
1196
            x: self.x.sub(rhs),
3✔
1197
            y: self.y.sub(rhs),
3✔
1198
            z: self.z.sub(rhs),
3✔
1199
        }
1200
    }
1201
}
1202

1203
impl Sub<&u8> for U8Vec3 {
1204
    type Output = U8Vec3;
1205
    #[inline]
1206
    fn sub(self, rhs: &u8) -> U8Vec3 {
3✔
1207
        self.sub(*rhs)
3✔
1208
    }
1209
}
1210

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

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

1227
impl SubAssign<u8> for U8Vec3 {
1228
    #[inline]
1229
    fn sub_assign(&mut self, rhs: u8) {
3✔
1230
        self.x.sub_assign(rhs);
3✔
1231
        self.y.sub_assign(rhs);
3✔
1232
        self.z.sub_assign(rhs);
3✔
1233
    }
1234
}
1235

1236
impl SubAssign<&u8> for U8Vec3 {
1237
    #[inline]
1238
    fn sub_assign(&mut self, rhs: &u8) {
3✔
1239
        self.sub_assign(*rhs)
3✔
1240
    }
1241
}
1242

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

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

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

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

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

1291
impl Rem<&U8Vec3> for U8Vec3 {
1292
    type Output = U8Vec3;
1293
    #[inline]
1294
    fn rem(self, rhs: &U8Vec3) -> U8Vec3 {
3✔
1295
        self.rem(*rhs)
3✔
1296
    }
1297
}
1298

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

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

1315
impl RemAssign<U8Vec3> for U8Vec3 {
1316
    #[inline]
1317
    fn rem_assign(&mut self, rhs: Self) {
3✔
1318
        self.x.rem_assign(rhs.x);
3✔
1319
        self.y.rem_assign(rhs.y);
3✔
1320
        self.z.rem_assign(rhs.z);
3✔
1321
    }
1322
}
1323

1324
impl RemAssign<&U8Vec3> for U8Vec3 {
1325
    #[inline]
1326
    fn rem_assign(&mut self, rhs: &U8Vec3) {
3✔
1327
        self.rem_assign(*rhs)
3✔
1328
    }
1329
}
1330

1331
impl Rem<u8> for U8Vec3 {
1332
    type Output = Self;
1333
    #[inline]
1334
    fn rem(self, rhs: u8) -> Self {
3✔
1335
        Self {
1336
            x: self.x.rem(rhs),
3✔
1337
            y: self.y.rem(rhs),
3✔
1338
            z: self.z.rem(rhs),
3✔
1339
        }
1340
    }
1341
}
1342

1343
impl Rem<&u8> for U8Vec3 {
1344
    type Output = U8Vec3;
1345
    #[inline]
1346
    fn rem(self, rhs: &u8) -> U8Vec3 {
3✔
1347
        self.rem(*rhs)
3✔
1348
    }
1349
}
1350

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

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

1367
impl RemAssign<u8> for U8Vec3 {
1368
    #[inline]
1369
    fn rem_assign(&mut self, rhs: u8) {
3✔
1370
        self.x.rem_assign(rhs);
3✔
1371
        self.y.rem_assign(rhs);
3✔
1372
        self.z.rem_assign(rhs);
3✔
1373
    }
1374
}
1375

1376
impl RemAssign<&u8> for U8Vec3 {
1377
    #[inline]
1378
    fn rem_assign(&mut self, rhs: &u8) {
3✔
1379
        self.rem_assign(*rhs)
3✔
1380
    }
1381
}
1382

1383
impl Rem<U8Vec3> for u8 {
1384
    type Output = U8Vec3;
1385
    #[inline]
1386
    fn rem(self, rhs: U8Vec3) -> U8Vec3 {
3✔
1387
        U8Vec3 {
1388
            x: self.rem(rhs.x),
3✔
1389
            y: self.rem(rhs.y),
3✔
1390
            z: self.rem(rhs.z),
3✔
1391
        }
1392
    }
1393
}
1394

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

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

1411
impl Rem<U8Vec3> for &u8 {
1412
    type Output = U8Vec3;
1413
    #[inline]
1414
    fn rem(self, rhs: U8Vec3) -> U8Vec3 {
3✔
1415
        (*self).rem(rhs)
3✔
1416
    }
1417
}
1418

1419
#[cfg(not(target_arch = "spirv"))]
1420
impl AsRef<[u8; 3]> for U8Vec3 {
1421
    #[inline]
1422
    fn as_ref(&self) -> &[u8; 3] {
3✔
1423
        unsafe { &*(self as *const U8Vec3 as *const [u8; 3]) }
3✔
1424
    }
1425
}
1426

1427
#[cfg(not(target_arch = "spirv"))]
1428
impl AsMut<[u8; 3]> for U8Vec3 {
1429
    #[inline]
1430
    fn as_mut(&mut self) -> &mut [u8; 3] {
3✔
1431
        unsafe { &mut *(self as *mut U8Vec3 as *mut [u8; 3]) }
3✔
1432
    }
1433
}
1434

1435
impl Sum for U8Vec3 {
1436
    #[inline]
1437
    fn sum<I>(iter: I) -> Self
3✔
1438
    where
1439
        I: Iterator<Item = Self>,
1440
    {
1441
        iter.fold(Self::ZERO, Self::add)
3✔
1442
    }
1443
}
1444

1445
impl<'a> Sum<&'a Self> for U8Vec3 {
1446
    #[inline]
1447
    fn sum<I>(iter: I) -> Self
3✔
1448
    where
1449
        I: Iterator<Item = &'a Self>,
1450
    {
1451
        iter.fold(Self::ZERO, |a, &b| Self::add(a, b))
9✔
1452
    }
1453
}
1454

1455
impl Product for U8Vec3 {
1456
    #[inline]
1457
    fn product<I>(iter: I) -> Self
3✔
1458
    where
1459
        I: Iterator<Item = Self>,
1460
    {
1461
        iter.fold(Self::ONE, Self::mul)
3✔
1462
    }
1463
}
1464

1465
impl<'a> Product<&'a Self> for U8Vec3 {
1466
    #[inline]
1467
    fn product<I>(iter: I) -> Self
3✔
1468
    where
1469
        I: Iterator<Item = &'a Self>,
1470
    {
1471
        iter.fold(Self::ONE, |a, &b| Self::mul(a, b))
9✔
1472
    }
1473
}
1474

1475
impl Not for U8Vec3 {
1476
    type Output = Self;
1477
    #[inline]
1478
    fn not(self) -> Self::Output {
3✔
1479
        Self {
1480
            x: self.x.not(),
3✔
1481
            y: self.y.not(),
3✔
1482
            z: self.z.not(),
3✔
1483
        }
1484
    }
1485
}
1486

1487
impl BitAnd for U8Vec3 {
1488
    type Output = Self;
1489
    #[inline]
1490
    fn bitand(self, rhs: Self) -> Self::Output {
3✔
1491
        Self {
1492
            x: self.x.bitand(rhs.x),
3✔
1493
            y: self.y.bitand(rhs.y),
3✔
1494
            z: self.z.bitand(rhs.z),
3✔
1495
        }
1496
    }
1497
}
1498

1499
impl BitOr for U8Vec3 {
1500
    type Output = Self;
1501
    #[inline]
1502
    fn bitor(self, rhs: Self) -> Self::Output {
3✔
1503
        Self {
1504
            x: self.x.bitor(rhs.x),
3✔
1505
            y: self.y.bitor(rhs.y),
3✔
1506
            z: self.z.bitor(rhs.z),
3✔
1507
        }
1508
    }
1509
}
1510

1511
impl BitXor for U8Vec3 {
1512
    type Output = Self;
1513
    #[inline]
1514
    fn bitxor(self, rhs: Self) -> Self::Output {
3✔
1515
        Self {
1516
            x: self.x.bitxor(rhs.x),
3✔
1517
            y: self.y.bitxor(rhs.y),
3✔
1518
            z: self.z.bitxor(rhs.z),
3✔
1519
        }
1520
    }
1521
}
1522

1523
impl BitAnd<u8> for U8Vec3 {
1524
    type Output = Self;
1525
    #[inline]
1526
    fn bitand(self, rhs: u8) -> Self::Output {
3✔
1527
        Self {
1528
            x: self.x.bitand(rhs),
3✔
1529
            y: self.y.bitand(rhs),
3✔
1530
            z: self.z.bitand(rhs),
3✔
1531
        }
1532
    }
1533
}
1534

1535
impl BitOr<u8> for U8Vec3 {
1536
    type Output = Self;
1537
    #[inline]
1538
    fn bitor(self, rhs: u8) -> Self::Output {
3✔
1539
        Self {
1540
            x: self.x.bitor(rhs),
3✔
1541
            y: self.y.bitor(rhs),
3✔
1542
            z: self.z.bitor(rhs),
3✔
1543
        }
1544
    }
1545
}
1546

1547
impl BitXor<u8> for U8Vec3 {
1548
    type Output = Self;
1549
    #[inline]
1550
    fn bitxor(self, rhs: u8) -> Self::Output {
3✔
1551
        Self {
1552
            x: self.x.bitxor(rhs),
3✔
1553
            y: self.y.bitxor(rhs),
3✔
1554
            z: self.z.bitxor(rhs),
3✔
1555
        }
1556
    }
1557
}
1558

1559
impl Shl<i8> for U8Vec3 {
1560
    type Output = Self;
1561
    #[inline]
1562
    fn shl(self, rhs: i8) -> Self::Output {
3✔
1563
        Self {
1564
            x: self.x.shl(rhs),
3✔
1565
            y: self.y.shl(rhs),
3✔
1566
            z: self.z.shl(rhs),
3✔
1567
        }
1568
    }
1569
}
1570

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

1583
impl Shl<i16> for U8Vec3 {
1584
    type Output = Self;
1585
    #[inline]
1586
    fn shl(self, rhs: i16) -> Self::Output {
3✔
1587
        Self {
1588
            x: self.x.shl(rhs),
3✔
1589
            y: self.y.shl(rhs),
3✔
1590
            z: self.z.shl(rhs),
3✔
1591
        }
1592
    }
1593
}
1594

1595
impl Shr<i16> for U8Vec3 {
1596
    type Output = Self;
1597
    #[inline]
1598
    fn shr(self, rhs: i16) -> Self::Output {
3✔
1599
        Self {
1600
            x: self.x.shr(rhs),
3✔
1601
            y: self.y.shr(rhs),
3✔
1602
            z: self.z.shr(rhs),
3✔
1603
        }
1604
    }
1605
}
1606

1607
impl Shl<i32> for U8Vec3 {
1608
    type Output = Self;
1609
    #[inline]
1610
    fn shl(self, rhs: i32) -> Self::Output {
3✔
1611
        Self {
1612
            x: self.x.shl(rhs),
3✔
1613
            y: self.y.shl(rhs),
3✔
1614
            z: self.z.shl(rhs),
3✔
1615
        }
1616
    }
1617
}
1618

1619
impl Shr<i32> for U8Vec3 {
1620
    type Output = Self;
1621
    #[inline]
1622
    fn shr(self, rhs: i32) -> Self::Output {
3✔
1623
        Self {
1624
            x: self.x.shr(rhs),
3✔
1625
            y: self.y.shr(rhs),
3✔
1626
            z: self.z.shr(rhs),
3✔
1627
        }
1628
    }
1629
}
1630

1631
impl Shl<i64> for U8Vec3 {
1632
    type Output = Self;
1633
    #[inline]
1634
    fn shl(self, rhs: i64) -> Self::Output {
3✔
1635
        Self {
1636
            x: self.x.shl(rhs),
3✔
1637
            y: self.y.shl(rhs),
3✔
1638
            z: self.z.shl(rhs),
3✔
1639
        }
1640
    }
1641
}
1642

1643
impl Shr<i64> for U8Vec3 {
1644
    type Output = Self;
1645
    #[inline]
1646
    fn shr(self, rhs: i64) -> Self::Output {
3✔
1647
        Self {
1648
            x: self.x.shr(rhs),
3✔
1649
            y: self.y.shr(rhs),
3✔
1650
            z: self.z.shr(rhs),
3✔
1651
        }
1652
    }
1653
}
1654

1655
impl Shl<u8> for U8Vec3 {
1656
    type Output = Self;
1657
    #[inline]
1658
    fn shl(self, rhs: u8) -> Self::Output {
3✔
1659
        Self {
1660
            x: self.x.shl(rhs),
3✔
1661
            y: self.y.shl(rhs),
3✔
1662
            z: self.z.shl(rhs),
3✔
1663
        }
1664
    }
1665
}
1666

1667
impl Shr<u8> for U8Vec3 {
1668
    type Output = Self;
1669
    #[inline]
1670
    fn shr(self, rhs: u8) -> Self::Output {
3✔
1671
        Self {
1672
            x: self.x.shr(rhs),
3✔
1673
            y: self.y.shr(rhs),
3✔
1674
            z: self.z.shr(rhs),
3✔
1675
        }
1676
    }
1677
}
1678

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

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

1703
impl Shl<u32> for U8Vec3 {
1704
    type Output = Self;
1705
    #[inline]
1706
    fn shl(self, rhs: u32) -> Self::Output {
3✔
1707
        Self {
1708
            x: self.x.shl(rhs),
3✔
1709
            y: self.y.shl(rhs),
3✔
1710
            z: self.z.shl(rhs),
3✔
1711
        }
1712
    }
1713
}
1714

1715
impl Shr<u32> for U8Vec3 {
1716
    type Output = Self;
1717
    #[inline]
1718
    fn shr(self, rhs: u32) -> Self::Output {
3✔
1719
        Self {
1720
            x: self.x.shr(rhs),
3✔
1721
            y: self.y.shr(rhs),
3✔
1722
            z: self.z.shr(rhs),
3✔
1723
        }
1724
    }
1725
}
1726

1727
impl Shl<u64> for U8Vec3 {
1728
    type Output = Self;
1729
    #[inline]
1730
    fn shl(self, rhs: u64) -> Self::Output {
3✔
1731
        Self {
1732
            x: self.x.shl(rhs),
3✔
1733
            y: self.y.shl(rhs),
3✔
1734
            z: self.z.shl(rhs),
3✔
1735
        }
1736
    }
1737
}
1738

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

1751
impl Shl<crate::IVec3> for U8Vec3 {
1752
    type Output = Self;
1753
    #[inline]
1754
    fn shl(self, rhs: crate::IVec3) -> Self::Output {
3✔
1755
        Self {
1756
            x: self.x.shl(rhs.x),
3✔
1757
            y: self.y.shl(rhs.y),
3✔
1758
            z: self.z.shl(rhs.z),
3✔
1759
        }
1760
    }
1761
}
1762

1763
impl Shr<crate::IVec3> for U8Vec3 {
1764
    type Output = Self;
1765
    #[inline]
1766
    fn shr(self, rhs: crate::IVec3) -> Self::Output {
3✔
1767
        Self {
1768
            x: self.x.shr(rhs.x),
3✔
1769
            y: self.y.shr(rhs.y),
3✔
1770
            z: self.z.shr(rhs.z),
3✔
1771
        }
1772
    }
1773
}
1774

1775
impl Shl<crate::UVec3> for U8Vec3 {
1776
    type Output = Self;
1777
    #[inline]
1778
    fn shl(self, rhs: crate::UVec3) -> Self::Output {
3✔
1779
        Self {
1780
            x: self.x.shl(rhs.x),
3✔
1781
            y: self.y.shl(rhs.y),
3✔
1782
            z: self.z.shl(rhs.z),
3✔
1783
        }
1784
    }
1785
}
1786

1787
impl Shr<crate::UVec3> for U8Vec3 {
1788
    type Output = Self;
1789
    #[inline]
1790
    fn shr(self, rhs: crate::UVec3) -> Self::Output {
3✔
1791
        Self {
1792
            x: self.x.shr(rhs.x),
3✔
1793
            y: self.y.shr(rhs.y),
3✔
1794
            z: self.z.shr(rhs.z),
3✔
1795
        }
1796
    }
1797
}
1798

1799
impl Index<usize> for U8Vec3 {
1800
    type Output = u8;
1801
    #[inline]
1802
    fn index(&self, index: usize) -> &Self::Output {
3✔
1803
        match index {
6✔
1804
            0 => &self.x,
3✔
1805
            1 => &self.y,
3✔
1806
            2 => &self.z,
3✔
1807
            _ => panic!("index out of bounds"),
×
1808
        }
1809
    }
1810
}
1811

1812
impl IndexMut<usize> for U8Vec3 {
1813
    #[inline]
1814
    fn index_mut(&mut self, index: usize) -> &mut Self::Output {
3✔
1815
        match index {
6✔
1816
            0 => &mut self.x,
3✔
1817
            1 => &mut self.y,
3✔
1818
            2 => &mut self.z,
3✔
1819
            _ => panic!("index out of bounds"),
×
1820
        }
1821
    }
1822
}
1823

1824
impl fmt::Display for U8Vec3 {
1825
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
3✔
1826
        write!(f, "[{}, {}, {}]", self.x, self.y, self.z)
3✔
1827
    }
1828
}
1829

1830
impl fmt::Debug for U8Vec3 {
1831
    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
3✔
1832
        fmt.debug_tuple(stringify!(U8Vec3))
9✔
1833
            .field(&self.x)
1834
            .field(&self.y)
3✔
1835
            .field(&self.z)
3✔
1836
            .finish()
1837
    }
1838
}
1839

1840
impl From<[u8; 3]> for U8Vec3 {
1841
    #[inline]
1842
    fn from(a: [u8; 3]) -> Self {
6✔
1843
        Self::new(a[0], a[1], a[2])
12✔
1844
    }
1845
}
1846

1847
impl From<U8Vec3> for [u8; 3] {
1848
    #[inline]
1849
    fn from(v: U8Vec3) -> Self {
3✔
1850
        [v.x, v.y, v.z]
3✔
1851
    }
1852
}
1853

1854
impl From<(u8, u8, u8)> for U8Vec3 {
1855
    #[inline]
1856
    fn from(t: (u8, u8, u8)) -> Self {
3✔
1857
        Self::new(t.0, t.1, t.2)
6✔
1858
    }
1859
}
1860

1861
impl From<U8Vec3> for (u8, u8, u8) {
1862
    #[inline]
1863
    fn from(v: U8Vec3) -> Self {
6✔
1864
        (v.x, v.y, v.z)
6✔
1865
    }
1866
}
1867

1868
impl From<(U8Vec2, u8)> for U8Vec3 {
1869
    #[inline]
1870
    fn from((v, z): (U8Vec2, u8)) -> Self {
×
1871
        Self::new(v.x, v.y, z)
×
1872
    }
1873
}
1874

1875
impl TryFrom<I8Vec3> for U8Vec3 {
1876
    type Error = core::num::TryFromIntError;
1877

1878
    #[inline]
1879
    fn try_from(v: I8Vec3) -> Result<Self, Self::Error> {
3✔
1880
        Ok(Self::new(
3✔
1881
            u8::try_from(v.x)?,
6✔
1882
            u8::try_from(v.y)?,
9✔
1883
            u8::try_from(v.z)?,
9✔
1884
        ))
1885
    }
1886
}
1887

1888
impl TryFrom<I16Vec3> for U8Vec3 {
1889
    type Error = core::num::TryFromIntError;
1890

1891
    #[inline]
1892
    fn try_from(v: I16Vec3) -> Result<Self, Self::Error> {
3✔
1893
        Ok(Self::new(
3✔
1894
            u8::try_from(v.x)?,
6✔
1895
            u8::try_from(v.y)?,
9✔
1896
            u8::try_from(v.z)?,
9✔
1897
        ))
1898
    }
1899
}
1900

1901
impl TryFrom<U16Vec3> for U8Vec3 {
1902
    type Error = core::num::TryFromIntError;
1903

1904
    #[inline]
1905
    fn try_from(v: U16Vec3) -> Result<Self, Self::Error> {
3✔
1906
        Ok(Self::new(
3✔
1907
            u8::try_from(v.x)?,
6✔
1908
            u8::try_from(v.y)?,
9✔
1909
            u8::try_from(v.z)?,
9✔
1910
        ))
1911
    }
1912
}
1913

1914
impl TryFrom<IVec3> for U8Vec3 {
1915
    type Error = core::num::TryFromIntError;
1916

1917
    #[inline]
1918
    fn try_from(v: IVec3) -> Result<Self, Self::Error> {
3✔
1919
        Ok(Self::new(
3✔
1920
            u8::try_from(v.x)?,
6✔
1921
            u8::try_from(v.y)?,
9✔
1922
            u8::try_from(v.z)?,
9✔
1923
        ))
1924
    }
1925
}
1926

1927
impl TryFrom<UVec3> for U8Vec3 {
1928
    type Error = core::num::TryFromIntError;
1929

1930
    #[inline]
1931
    fn try_from(v: UVec3) -> Result<Self, Self::Error> {
3✔
1932
        Ok(Self::new(
3✔
1933
            u8::try_from(v.x)?,
6✔
1934
            u8::try_from(v.y)?,
9✔
1935
            u8::try_from(v.z)?,
9✔
1936
        ))
1937
    }
1938
}
1939

1940
impl TryFrom<I64Vec3> for U8Vec3 {
1941
    type Error = core::num::TryFromIntError;
1942

1943
    #[inline]
1944
    fn try_from(v: I64Vec3) -> Result<Self, Self::Error> {
3✔
1945
        Ok(Self::new(
3✔
1946
            u8::try_from(v.x)?,
6✔
1947
            u8::try_from(v.y)?,
9✔
1948
            u8::try_from(v.z)?,
9✔
1949
        ))
1950
    }
1951
}
1952

1953
impl TryFrom<U64Vec3> for U8Vec3 {
1954
    type Error = core::num::TryFromIntError;
1955

1956
    #[inline]
1957
    fn try_from(v: U64Vec3) -> Result<Self, Self::Error> {
3✔
1958
        Ok(Self::new(
3✔
1959
            u8::try_from(v.x)?,
6✔
1960
            u8::try_from(v.y)?,
9✔
1961
            u8::try_from(v.z)?,
9✔
1962
        ))
1963
    }
1964
}
1965

1966
impl From<BVec3> for U8Vec3 {
1967
    #[inline]
1968
    fn from(v: BVec3) -> Self {
3✔
1969
        Self::new(u8::from(v.x), u8::from(v.y), u8::from(v.z))
6✔
1970
    }
1971
}
1972

1973
impl From<BVec3A> for U8Vec3 {
1974
    #[inline]
1975
    fn from(v: BVec3A) -> Self {
3✔
1976
        let bool_array: [bool; 3] = v.into();
3✔
1977
        Self::new(
1978
            u8::from(bool_array[0]),
3✔
1979
            u8::from(bool_array[1]),
3✔
1980
            u8::from(bool_array[2]),
3✔
1981
        )
1982
    }
1983
}
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