swc_ecma_utils

Trait StmtOrModuleItem

source
pub trait StmtOrModuleItem:
    Send
    + Sync
    + Sized {
    // 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>;
}

Required Methods§

source

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

source

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

source

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

source

fn from_stmt(stmt: Stmt) -> Self

source

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

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl StmtOrModuleItem for ModuleItem

source§

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

source§

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

source§

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

source§

fn from_stmt(stmt: Stmt) -> Self

source§

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

source§

impl StmtOrModuleItem for Stmt

source§

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

source§

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

source§

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

source§

fn from_stmt(stmt: Stmt) -> Self

source§

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

Implementors§