swc_core::ecma::utils

Trait StmtOrModuleItem

pub trait StmtOrModuleItem:
    Sized
    + Send
    + Sync {
    // Required methods
    fn into_stmt(self) -> Result<Stmt, ModuleDecl>;
    fn as_stmt(&self) -> Result<&Stmt, &ModuleDecl>;
    fn as_stmt_mut(&mut self) -> Result<&mut Stmt, &mut ModuleDecl>;
    fn from_stmt(stmt: Stmt) -> Self;
    fn try_from_module_decl(decl: ModuleDecl) -> Result<Self, ModuleDecl>;
}
Available on crate features __ecma and __utils only.

Required Methods§

fn into_stmt(self) -> Result<Stmt, ModuleDecl>

fn as_stmt(&self) -> Result<&Stmt, &ModuleDecl>

fn as_stmt_mut(&mut self) -> Result<&mut Stmt, &mut ModuleDecl>

fn from_stmt(stmt: Stmt) -> Self

fn try_from_module_decl(decl: ModuleDecl) -> Result<Self, ModuleDecl>

Object Safety§

This trait is not object safe.

Implementors§