pub enum GoStmt {
Show 18 variants
Const(String, Option<GoType>, GoExpr),
Var(String, GoType, Option<GoExpr>),
ShortDecl(String, GoExpr),
Assign(GoExpr, GoExpr),
Return(Vec<GoExpr>),
If(GoExpr, Vec<GoStmt>, Vec<GoStmt>),
Switch(Option<GoExpr>, Vec<GoCase>),
For(Option<Box<GoStmt>>, Option<GoExpr>, Option<Box<GoStmt>>, Vec<GoStmt>),
ForRange(Option<String>, Option<String>, GoExpr, Vec<GoStmt>),
Block(Vec<GoStmt>),
Expr(GoExpr),
Break,
Continue,
Goto(String),
Label(String, Box<GoStmt>),
Defer(GoExpr),
GoRoutine(GoExpr),
Panic(GoExpr),
}Expand description
Go statement for code generation.
Variants§
Const(String, Option<GoType>, GoExpr)
const name type = value
Var(String, GoType, Option<GoExpr>)
var name type or var name type = value
ShortDecl(String, GoExpr)
Short variable declaration: name := value
Assign(GoExpr, GoExpr)
Assignment: target = value
Return(Vec<GoExpr>)
Return statement: return exprs...
If(GoExpr, Vec<GoStmt>, Vec<GoStmt>)
If statement with optional else
Switch(Option<GoExpr>, Vec<GoCase>)
Switch statement: switch scrutinee { case ... }
For(Option<Box<GoStmt>>, Option<GoExpr>, Option<Box<GoStmt>>, Vec<GoStmt>)
For loop: for init; cond; post { body }
ForRange(Option<String>, Option<String>, GoExpr, Vec<GoStmt>)
Range-based for: for k, v := range expr { body }
Block(Vec<GoStmt>)
A block of statements: { stmts }
Expr(GoExpr)
A bare expression statement
Break
Break statement
Continue
Continue statement
Goto(String)
Goto label
Label(String, Box<GoStmt>)
Label statement
Defer(GoExpr)
Defer statement
GoRoutine(GoExpr)
Go statement (goroutine)
Panic(GoExpr)
Panic
Trait Implementations§
impl StructuralPartialEq for GoStmt
Auto Trait Implementations§
impl Freeze for GoStmt
impl RefUnwindSafe for GoStmt
impl Send for GoStmt
impl Sync for GoStmt
impl Unpin for GoStmt
impl UnsafeUnpin for GoStmt
impl UnwindSafe for GoStmt
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