pub enum WGSLExpr {
Literal(String),
Var(String),
BinOp {
op: String,
lhs: Box<WGSLExpr>,
rhs: Box<WGSLExpr>,
},
UnaryOp {
op: String,
operand: Box<WGSLExpr>,
},
Call {
func: String,
args: Vec<WGSLExpr>,
},
Field {
base: Box<WGSLExpr>,
field: String,
},
Index {
base: Box<WGSLExpr>,
index: Box<WGSLExpr>,
},
}Expand description
A simple WGSL expression for code generation purposes.
Variants§
Literal(String)
A literal value token.
Var(String)
A variable reference.
BinOp
A binary infix operation.
UnaryOp
A unary prefix operation.
Call
A function or constructor call.
Field
A field access: base.field.
Index
An array/vector index: base[index].
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WGSLExpr
impl RefUnwindSafe for WGSLExpr
impl Send for WGSLExpr
impl Sync for WGSLExpr
impl Unpin for WGSLExpr
impl UnsafeUnpin for WGSLExpr
impl UnwindSafe for WGSLExpr
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