spirv_std::vector

Trait VectorOrScalar

Source
pub unsafe trait VectorOrScalar:
    Copy
    + Default
    + Send
    + Sync
    + 'static {
    type Scalar: Scalar;

    const DIM: NonZeroUsize;
}
Expand description

Abstract trait representing either a vector or a scalar type.

§Safety

Implementing this trait on non-scalar or non-vector types may break assumptions about other unsafe code, and should not be done.

Required Associated Constants§

Source

const DIM: NonZeroUsize

The dimension of the vector, or 1 if it is a scalar

Required Associated Types§

Source

type Scalar: Scalar

Either the scalar component type of the vector or the scalar itself.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl VectorOrScalar for bool

Source§

impl VectorOrScalar for f32

Source§

impl VectorOrScalar for f64

Source§

impl VectorOrScalar for i8

Source§

impl VectorOrScalar for i16

Source§

impl VectorOrScalar for i32

Source§

impl VectorOrScalar for i64

Source§

impl VectorOrScalar for u8

Source§

impl VectorOrScalar for u16

Source§

impl VectorOrScalar for u32

Source§

impl VectorOrScalar for u64

Source§

impl VectorOrScalar for Vec3A

Source§

impl VectorOrScalar for Vec4

Source§

impl VectorOrScalar for Vec2

Source§

impl VectorOrScalar for Vec3

Source§

impl VectorOrScalar for DVec2

Source§

impl VectorOrScalar for DVec3

Source§

impl VectorOrScalar for DVec4

Source§

impl VectorOrScalar for IVec2

Source§

impl VectorOrScalar for IVec3

Source§

impl VectorOrScalar for IVec4

Source§

impl VectorOrScalar for UVec2

Source§

impl VectorOrScalar for UVec3

Source§

impl VectorOrScalar for UVec4

Implementors§