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>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so 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§