pub enum Stmt {
Show 15 variants
Assembly(StmtAssembly),
Block(Block),
Break(StmtBreak),
Continue(StmtContinue),
DoWhile(StmtDoWhile),
Emit(StmtEmit),
Expr(StmtExpr),
For(StmtFor),
If(StmtIf),
Return(StmtReturn),
Revert(StmtRevert),
Try(StmtTry),
UncheckedBlock(UncheckedBlock),
VarDecl(StmtVarDecl),
While(StmtWhile),
}
Expand description
A statement, usually ending in a semicolon.
Solidity reference: https://docs.soliditylang.org/en/latest/grammar.html#a4.SolidityParser.statement
Variants§
Assembly(StmtAssembly)
An assembly block, with optional flags: assembly "evmasm" { ... }
.
Block(Block)
A blocked scope: { ... }
.
Break(StmtBreak)
A break statement: break;
.
Continue(StmtContinue)
A continue statement: continue;
.
DoWhile(StmtDoWhile)
A do-while statement: do { ... } while (condition);
.
Emit(StmtEmit)
An emit statement: emit FooBar(42);
.
Expr(StmtExpr)
An expression with a trailing semicolon.
For(StmtFor)
A for statement: for (uint256 i; i < 42; ++i) { ... }
.
If(StmtIf)
An if
statement with an optional else
block: if (expr) { ... } else { ... }
.
Return(StmtReturn)
A return statement: return 42;
.
Revert(StmtRevert)
A revert statement: revert("error");
.
Try(StmtTry)
A try statement: try fooBar(42) catch { ... }
.
UncheckedBlock(UncheckedBlock)
An unchecked block: unchecked { ... }
.
VarDecl(StmtVarDecl)
A variable declaration statement: uint256 foo = 42;
.
While(StmtWhile)
A while statement: while (i < 42) { ... }
.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Stmt
impl RefUnwindSafe for Stmt
impl !Send for Stmt
impl !Sync for Stmt
impl Unpin for Stmt
impl UnwindSafe for Stmt
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)