pub enum StmtKind {
Show 23 variants
Empty,
Block(Vec<Stmt>),
Expr(Box<Expr>),
If {
test: Box<Expr>,
cons: Box<Stmt>,
alt: Option<Box<Stmt>>,
},
DoWhile {
body: Box<Stmt>,
test: Box<Expr>,
},
While {
test: Box<Expr>,
body: Box<Stmt>,
},
For {
init: Option<ForInit>,
test: Option<Box<Expr>>,
update: Option<Box<Expr>>,
body: Box<Stmt>,
},
ForIn {
left: ForHead,
right: Box<Expr>,
body: Box<Stmt>,
},
ForOf {
is_await: bool,
left: ForHead,
right: Box<Expr>,
body: Box<Stmt>,
},
Continue(Option<Ident>),
Break(Option<Ident>),
Return(Option<Box<Expr>>),
With {
object: Box<Expr>,
body: Box<Stmt>,
},
Labeled {
label: Ident,
body: Box<Stmt>,
},
Switch {
discriminant: Box<Expr>,
cases: Vec<SwitchCase>,
},
Throw(Box<Expr>),
Try {
block: Vec<Stmt>,
handler: Option<CatchClause>,
finalizer: Option<Vec<Stmt>>,
},
Debugger,
VarDecl(VarDecl),
FuncDecl(Box<Function>),
ClassDecl(Box<Class>),
Import(Box<ImportDecl>),
Export(Box<ExportDecl>),
}Expand description
Statement and declaration nodes (StatementListItem).
Variants§
Empty
;
Block(Vec<Stmt>)
{ ... }
Expr(Box<Expr>)
expr;
If
if (test) cons else alt
DoWhile
do body while (test);
While
while (test) body
For
for (init; test; update) body
Fields
ForIn
for (decl|lhs in expr) body
ForOf
for (decl|lhs of expr) body, plus for await (…)
Fields
Continue(Option<Ident>)
continue; / continue label;
Break(Option<Ident>)
break; / break label;
Return(Option<Box<Expr>>)
return; / return expr;
With
with (obj) body
Fields
Labeled
label: stmt
Switch
switch (disc) { cases }
Throw(Box<Expr>)
throw expr;
Try
try { } catch (e) { } finally { }
Fields
§
handler: Option<CatchClause>Catch clause, if present.
Debugger
debugger;
VarDecl(VarDecl)
var/let/const declaration.
FuncDecl(Box<Function>)
function declaration.
ClassDecl(Box<Class>)
class declaration.
Import(Box<ImportDecl>)
import declaration (modules only).
Export(Box<ExportDecl>)
export declaration (modules only).
Trait Implementations§
impl StructuralPartialEq for StmtKind
Auto Trait Implementations§
impl Forget for StmtKind
impl Freeze for StmtKindwhere
*const u8 is !null: Freeze,
PhantomData<Stmt>: Freeze,
*const Expr is !null: Freeze,
PhantomData<Expr>: Freeze,
*const Stmt is !null: Freeze,
PhantomData<Declarator>: Freeze,
*const Pattern is !null: Freeze,
PhantomData<Pattern>: Freeze,
PhantomData<u8>: Freeze,
PhantomData<SwitchCase>: Freeze,
PhantomData<Option<PatternElement>>: Freeze,
*const RestElement is !null: Freeze,
PhantomData<RestElement>: Freeze,
*const MemberPattern is !null: Freeze,
PhantomData<MemberPattern>: Freeze,
*const Function is !null: Freeze,
PhantomData<Function>: Freeze,
*const Class is !null: Freeze,
PhantomData<Class>: Freeze,
*const ImportDecl is !null: Freeze,
PhantomData<ImportDecl>: Freeze,
*const ExportDecl is !null: Freeze,
PhantomData<ExportDecl>: Freeze,
impl Move for StmtKind
impl RefUnwindSafe for StmtKind
impl Send for StmtKindwhere
RawVecInner: Send,
BoxRaw<Expr>: Send,
BoxRaw<Stmt>: Send,
BoxRaw<RestElement>: Send,
BoxRaw<Pattern>: Send,
BoxRaw<MemberPattern>: Send,
BoxRaw<Function>: Send,
BoxRaw<Class>: Send,
BoxRaw<ImportDecl>: Send,
BoxRaw<ExportDecl>: Send,
impl Sync for StmtKindwhere
RawVecInner: Sync,
BoxRaw<Expr>: Sync,
BoxRaw<Stmt>: Sync,
BoxRaw<RestElement>: Sync,
BoxRaw<Pattern>: Sync,
BoxRaw<MemberPattern>: Sync,
BoxRaw<Function>: Sync,
BoxRaw<Class>: Sync,
BoxRaw<ImportDecl>: Sync,
BoxRaw<ExportDecl>: Sync,
impl Unpin for StmtKind
impl UnsafeUnpin for StmtKindwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<Stmt>: UnsafeUnpin,
*const Expr is !null: UnsafeUnpin,
PhantomData<Expr>: UnsafeUnpin,
*const Stmt is !null: UnsafeUnpin,
PhantomData<Declarator>: UnsafeUnpin,
*const Pattern is !null: UnsafeUnpin,
PhantomData<Pattern>: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<SwitchCase>: UnsafeUnpin,
PhantomData<Option<PatternElement>>: UnsafeUnpin,
*const RestElement is !null: UnsafeUnpin,
PhantomData<RestElement>: UnsafeUnpin,
*const MemberPattern is !null: UnsafeUnpin,
PhantomData<MemberPattern>: UnsafeUnpin,
*const Function is !null: UnsafeUnpin,
PhantomData<Function>: UnsafeUnpin,
*const Class is !null: UnsafeUnpin,
PhantomData<Class>: UnsafeUnpin,
*const ImportDecl is !null: UnsafeUnpin,
PhantomData<ImportDecl>: UnsafeUnpin,
*const ExportDecl is !null: UnsafeUnpin,
PhantomData<ExportDecl>: UnsafeUnpin,
impl UnwindSafe for StmtKindwhere
RawVecInner: UnwindSafe,
BoxRaw<Expr>: UnwindSafe,
BoxRaw<Stmt>: UnwindSafe,
BoxRaw<RestElement>: UnwindSafe,
BoxRaw<Pattern>: UnwindSafe,
BoxRaw<MemberPattern>: UnwindSafe,
BoxRaw<Function>: UnwindSafe,
BoxRaw<Class>: UnwindSafe,
BoxRaw<ImportDecl>: UnwindSafe,
BoxRaw<ExportDecl>: UnwindSafe,
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