spirv_std::integer

Trait Integer

Source
pub unsafe trait Integer: PrimInt + Scalar {
    const WIDTH: usize;
    const SIGNED: bool;
}
Expand description

Abstract trait representing any SPIR-V integer type.

§Safety

Implementing this trait on non-primitive-integer types breaks assumptions of other unsafe code, and should not be done.

Required Associated Constants§

Source

const WIDTH: usize

Width of the integer, in bits.

Source

const SIGNED: bool

If the integer is signed: true means signed, false means unsigned.

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 Integer for i8

Source§

const WIDTH: usize = 8usize

Source§

const SIGNED: bool = true

Source§

impl Integer for i16

Source§

const WIDTH: usize = 16usize

Source§

const SIGNED: bool = true

Source§

impl Integer for i32

Source§

const WIDTH: usize = 32usize

Source§

const SIGNED: bool = true

Source§

impl Integer for i64

Source§

const WIDTH: usize = 64usize

Source§

const SIGNED: bool = true

Source§

impl Integer for u8

Source§

const WIDTH: usize = 8usize

Source§

const SIGNED: bool = false

Source§

impl Integer for u16

Source§

const WIDTH: usize = 16usize

Source§

const SIGNED: bool = false

Source§

impl Integer for u32

Source§

const WIDTH: usize = 32usize

Source§

const SIGNED: bool = false

Source§

impl Integer for u64

Source§

const WIDTH: usize = 64usize

Source§

const SIGNED: bool = false

Implementors§