pub enum StorageType {
Scalar(ElemType),
Packed(ElemType, u32),
Atomic(ElemType),
}Expand description
Physical type containing one or more elements
Variants§
Scalar(ElemType)
ElemType is the same as the physical type
Packed(ElemType, u32)
Packed values of type ElemType
Atomic(ElemType)
Atomically accessed version of ElemType
Implementations§
Source§impl StorageType
impl StorageType
pub fn elem_type(&self) -> ElemType
pub fn packing_factor(&self) -> u32
pub fn is_atomic(&self) -> bool
pub fn size(&self) -> usize
pub fn size_bits(&self) -> usize
Sourcepub fn from_constant(&self, constant: Variable) -> Variable
pub fn from_constant(&self, constant: Variable) -> Variable
Ensure that the variable provided, when a constant, is the same type as elem.
pub fn is_int(&self) -> bool
pub fn is_signed_int(&self) -> bool
pub fn is_unsigned_int(&self) -> bool
pub fn is_float(&self) -> bool
Trait Implementations§
Source§impl Clone for StorageType
impl Clone for StorageType
Source§fn clone(&self) -> StorageType
fn clone(&self) -> StorageType
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 StorageType
impl Debug for StorageType
Source§impl<'de> Deserialize<'de> for StorageType
impl<'de> Deserialize<'de> for StorageType
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for StorageType
impl Display for StorageType
Source§impl From<ElemType> for StorageType
impl From<ElemType> for StorageType
Source§impl From<StorageType> for Type
impl From<StorageType> for Type
Source§fn from(val: StorageType) -> Self
fn from(val: StorageType) -> Self
Converts to this type from the input type.
Source§impl Hash for StorageType
impl Hash for StorageType
Source§impl Ord for StorageType
impl Ord for StorageType
Source§fn cmp(&self, other: &StorageType) -> Ordering
fn cmp(&self, other: &StorageType) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for StorageType
impl PartialEq for StorageType
Source§impl PartialOrd for StorageType
impl PartialOrd for StorageType
Source§impl Serialize for StorageType
impl Serialize for StorageType
Source§impl TypeHash for StorageType
impl TypeHash for StorageType
impl Copy for StorageType
impl Eq for StorageType
impl StructuralPartialEq for StorageType
Auto Trait Implementations§
impl Freeze for StorageType
impl RefUnwindSafe for StorageType
impl Send for StorageType
impl Sync for StorageType
impl Unpin for StorageType
impl UnwindSafe for StorageType
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.