pub struct VarDefine<Var: IRValue> {
pub ty: Var::VarDefineType,
pub name: String,
pub init: Option<Var::AssignValue>,
pub is_temp: bool,
}
Fields§
§ty: Var::VarDefineType
the type of the variable
name: String
the name of the variable, either a named variable or a temp variable from computing
init: Option<Var::AssignValue>
the initial value of the variable
None
represents the variable is not initialized when it was created
is_temp: bool
a temp value
will only be immediately used once in expressions
this is a hint for code generation backend optimization
code generation backend can directly inline init
only when is_temp
is true
Trait Implementations§
Source§impl<'de, Var: IRValue> Deserialize<'de> for VarDefine<Var>where
Var::VarDefineType: Deserialize<'de>,
impl<'de, Var: IRValue> Deserialize<'de> for VarDefine<Var>where
Var::VarDefineType: Deserialize<'de>,
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
Auto Trait Implementations§
impl<Var> Freeze for VarDefine<Var>
impl<Var> RefUnwindSafe for VarDefine<Var>
impl<Var> Send for VarDefine<Var>
impl<Var> Sync for VarDefine<Var>
impl<Var> Unpin for VarDefine<Var>
impl<Var> UnwindSafe for VarDefine<Var>
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