pub struct Variable {
pub kind: VariableKind,
pub ty: Type,
}Fields§
§kind: VariableKind§ty: TypeImplementations§
Source§impl Variable
impl Variable
pub fn new(kind: VariableKind, item: Type) -> Variable
pub fn builtin(builtin: Builtin) -> Variable
pub fn constant(scalar: ConstantScalarValue) -> Variable
pub fn elem_type(&self) -> ElemType
pub fn storage_type(&self) -> StorageType
Source§impl Variable
impl Variable
Sourcepub fn is_immutable(&self) -> bool
pub fn is_immutable(&self) -> bool
Whether a variable is always immutable. Used for optimizations to determine whether it’s safe to inline/merge
Sourcepub fn is_array(&self) -> bool
pub fn is_array(&self) -> bool
Is this an array type that yields [Item]s when indexed, or a scalar/vector that yields
[Elem]s when indexed?
pub fn has_length(&self) -> bool
pub fn has_buffer_length(&self) -> bool
Sourcepub fn is_constant(&self, value: i64) -> bool
pub fn is_constant(&self, value: i64) -> bool
Determines if the value is a constant with the specified value (converted if necessary)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Variable
impl<'de> Deserialize<'de> for Variable
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Variable, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Variable, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<const POS: u8> From<ElemExpand<POS>> for Variable
impl<const POS: u8> From<ElemExpand<POS>> for Variable
Source§fn from(val: ElemExpand<POS>) -> Variable
fn from(val: ElemExpand<POS>) -> Variable
Converts to this type from the input type.
Source§impl From<ExpandElement> for Variable
impl From<ExpandElement> for Variable
Source§fn from(value: ExpandElement) -> Variable
fn from(value: ExpandElement) -> Variable
Converts to this type from the input type.
Source§impl<T> From<ExpandElementTyped<T>> for Variablewhere
T: CubeType,
impl<T> From<ExpandElementTyped<T>> for Variablewhere
T: CubeType,
Source§fn from(value: ExpandElementTyped<T>) -> Variable
fn from(value: ExpandElementTyped<T>) -> Variable
Converts to this type from the input type.
Source§impl FromArgList for Variable
impl FromArgList for Variable
Source§fn from_arg_list(args: &mut VecDeque<Variable>) -> Variable
fn from_arg_list(args: &mut VecDeque<Variable>) -> Variable
Creates this type from a list of variables. This works like a parse stream, where consumed
variables are popped from the front.
Source§fn as_arg_list(&self) -> impl IntoIterator<Item = Variable>
fn as_arg_list(&self) -> impl IntoIterator<Item = Variable>
Turns this type into a list of
Variables.Source§impl OperationArgs for Variable
impl OperationArgs for Variable
Source§impl Serialize for Variable
impl Serialize for Variable
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Copy for Variable
impl Eq for Variable
impl StructuralPartialEq for Variable
Auto Trait Implementations§
impl Freeze for Variable
impl RefUnwindSafe for Variable
impl Send for Variable
impl Sync for Variable
impl Unpin for Variable
impl UnwindSafe for Variable
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)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.