spirv_std/scalar.rs
1//! Traits related to scalars.
2
3/// Abstract trait representing a SPIR-V scalar type.
4///
5/// # Safety
6/// Implementing this trait on non-scalar types breaks assumptions of other unsafe code, and should
7/// not be done.
8pub unsafe trait Scalar: Copy + Default + crate::sealed::Sealed {}
9
10unsafe impl Scalar for bool {}
11unsafe impl Scalar for f32 {}
12unsafe impl Scalar for f64 {}
13unsafe impl Scalar for u8 {}
14unsafe impl Scalar for u16 {}
15unsafe impl Scalar for u32 {}
16unsafe impl Scalar for u64 {}
17unsafe impl Scalar for i8 {}
18unsafe impl Scalar for i16 {}
19unsafe impl Scalar for i32 {}
20unsafe impl Scalar for i64 {}