pub enum WGSLStatement {
Show 15 variants
Let {
name: String,
ty: Option<WGSLType>,
init: String,
},
Var {
name: String,
ty: Option<WGSLType>,
init: Option<String>,
},
Assign {
lhs: String,
rhs: String,
},
CompoundAssign {
lhs: String,
op: String,
rhs: String,
},
If {
cond: String,
then_stmts: Vec<WGSLStatement>,
else_stmts: Vec<WGSLStatement>,
},
For {
init: Option<Box<WGSLStatement>>,
cond: Option<String>,
update: Option<Box<WGSLStatement>>,
body: Vec<WGSLStatement>,
},
While {
cond: String,
body: Vec<WGSLStatement>,
},
Loop {
body: Vec<WGSLStatement>,
continuing: Vec<WGSLStatement>,
},
Switch {
expr: String,
cases: Vec<(String, Vec<WGSLStatement>)>,
default: Vec<WGSLStatement>,
},
Return(Option<String>),
Break,
Continue,
Discard,
Raw(String),
Call {
func: String,
args: Vec<String>,
},
}Expand description
A WGSL statement (higher-level than raw strings).
Variants§
Let
let name: ty = expr;
Var
var name: ty = expr;
Assign
lhs = rhs;
CompoundAssign
lhs op= rhs; (compound assignment)
If
if (cond) { ... } else { ... }
For
for (init; cond; update) { ... }
While
while (cond) { ... }
Loop
loop { ... continuing { ... } }
Switch
switch (expr) { case v: { ... } default: { ... } }
Return(Option<String>)
return expr;
Break
break;
Continue
continue;
Discard
discard;
Raw(String)
Raw string statement.
Call
Function call as a statement.
Implementations§
Trait Implementations§
Source§impl Clone for WGSLStatement
impl Clone for WGSLStatement
Source§fn clone(&self) -> WGSLStatement
fn clone(&self) -> WGSLStatement
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 moreAuto Trait Implementations§
impl Freeze for WGSLStatement
impl RefUnwindSafe for WGSLStatement
impl Send for WGSLStatement
impl Sync for WGSLStatement
impl Unpin for WGSLStatement
impl UnsafeUnpin for WGSLStatement
impl UnwindSafe for WGSLStatement
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