Trait StmtExt

Source
pub trait StmtExt {
    // Required method
    fn as_stmt(&self) -> &Stmt;

    // Provided methods
    fn extract_var_ids(&self) -> Vec<Ident> { ... }
    fn extract_var_ids_as_var(&self) -> Option<VarDecl> { ... }
    fn terminates(&self) -> bool { ... }
    fn may_have_side_effects(&self, ctx: ExprCtx) -> bool { ... }
}

Required Methods§

Source

fn as_stmt(&self) -> &Stmt

Provided Methods§

Source

fn extract_var_ids(&self) -> Vec<Ident>

Extracts hoisted variables

Source

fn extract_var_ids_as_var(&self) -> Option<VarDecl>

Source

fn terminates(&self) -> bool

stmts contain top level return/break/continue/throw

Source

fn may_have_side_effects(&self, ctx: ExprCtx) -> bool

Implementations on Foreign Types§

Source§

impl StmtExt for Stmt

Source§

fn as_stmt(&self) -> &Stmt

Source§

impl StmtExt for Box<Stmt>

Source§

fn as_stmt(&self) -> &Stmt

Implementors§