pub enum ScalarType {
Bool,
I8,
I16,
I32,
I64,
U8,
U16,
U32,
U64,
F16,
F32,
F64,
}Expand description
Scalar types supported in IR.
Variants§
Bool
Boolean.
I8
8-bit signed integer.
I16
16-bit signed integer.
I32
32-bit signed integer.
I64
64-bit signed integer.
U8
8-bit unsigned integer.
U16
16-bit unsigned integer.
U32
32-bit unsigned integer.
U64
64-bit unsigned integer.
F16
16-bit floating point.
F32
32-bit floating point.
F64
64-bit floating point (not supported on all backends).
Implementations§
Source§impl ScalarType
impl ScalarType
Sourcepub fn size_bytes(&self) -> usize
pub fn size_bytes(&self) -> usize
Get the size in bytes.
Sourcepub fn is_signed_int(&self) -> bool
pub fn is_signed_int(&self) -> bool
Check if this is a signed integer type.
Sourcepub fn is_unsigned_int(&self) -> bool
pub fn is_unsigned_int(&self) -> bool
Check if this is an unsigned integer type.
Sourcepub fn requires_f64(&self) -> bool
pub fn requires_f64(&self) -> bool
Check if this requires special capability (f64).
Sourcepub fn requires_i64(&self) -> bool
pub fn requires_i64(&self) -> bool
Check if this requires 64-bit integer capability.
Trait Implementations§
Source§impl Clone for ScalarType
impl Clone for ScalarType
Source§fn clone(&self) -> ScalarType
fn clone(&self) -> ScalarType
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ScalarType
impl Debug for ScalarType
Source§impl Display for ScalarType
impl Display for ScalarType
Source§impl Hash for ScalarType
impl Hash for ScalarType
Source§impl PartialEq for ScalarType
impl PartialEq for ScalarType
impl Copy for ScalarType
impl Eq for ScalarType
impl StructuralPartialEq for ScalarType
Auto Trait Implementations§
impl Freeze for ScalarType
impl RefUnwindSafe for ScalarType
impl Send for ScalarType
impl Sync for ScalarType
impl Unpin for ScalarType
impl UnwindSafe for ScalarType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more