pub struct Variable {
pub kind: VariableKind,
pub item: Item,
}
Fields§
§kind: VariableKind
§item: Item
Implementations§
Source§impl Variable
impl Variable
pub fn new(kind: VariableKind, item: Item) -> Self
pub fn builtin(builtin: Builtin) -> Self
pub fn constant(scalar: ConstantScalarValue) -> Self
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
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<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 From<ExpandElement> for Variable
impl From<ExpandElement> for Variable
Source§fn from(value: ExpandElement) -> Self
fn from(value: ExpandElement) -> Self
Converts to this type from the input type.
Source§impl<const POS: u8> From<FloatExpand<POS>> for Variable
impl<const POS: u8> From<FloatExpand<POS>> for Variable
Source§fn from(val: FloatExpand<POS>) -> Self
fn from(val: FloatExpand<POS>) -> Self
Converts to this type from the input type.
impl Copy 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§
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