Enum swc_ecma_ast::BlockStmtOrExpr
source · [−]Variants
BlockStmt(BlockStmt)
Expr(Box<Expr>)
Implementations
sourceimpl BlockStmtOrExpr
impl BlockStmtOrExpr
sourcepub fn is_block_stmt(&self) -> bool
pub fn is_block_stmt(&self) -> bool
Returns true
if self
is of variant BlockStmt
.
sourcepub fn as_block_stmt(&self) -> Option<&BlockStmt>
pub fn as_block_stmt(&self) -> Option<&BlockStmt>
Returns Some
if self
is a reference of variant BlockStmt
, and None
otherwise.
sourcepub fn as_mut_block_stmt(&mut self) -> Option<&mut BlockStmt>
pub fn as_mut_block_stmt(&mut self) -> Option<&mut BlockStmt>
Returns Some
if self
is a mutable reference of variant BlockStmt
, and None
otherwise.
sourcepub fn expect_block_stmt(self) -> BlockStmtwhere
Self: Debug,
pub fn expect_block_stmt(self) -> BlockStmtwhere
Self: Debug,
sourcepub fn block_stmt(self) -> Option<BlockStmt>
pub fn block_stmt(self) -> Option<BlockStmt>
Returns Some
if self
is of variant BlockStmt
, and None
otherwise.
sourcepub fn as_expr(&self) -> Option<&Box<Expr>>
pub fn as_expr(&self) -> Option<&Box<Expr>>
Returns Some
if self
is a reference of variant Expr
, and None
otherwise.
sourcepub fn as_mut_expr(&mut self) -> Option<&mut Box<Expr>>
pub fn as_mut_expr(&mut self) -> Option<&mut Box<Expr>>
Returns Some
if self
is a mutable reference of variant Expr
, and None
otherwise.
sourcepub fn expect_expr(self) -> Box<Expr>where
Self: Debug,
pub fn expect_expr(self) -> Box<Expr>where
Self: Debug,
Trait Implementations
sourceimpl Clone for BlockStmtOrExpr
impl Clone for BlockStmtOrExpr
sourcefn clone(&self) -> BlockStmtOrExpr
fn clone(&self) -> BlockStmtOrExpr
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for BlockStmtOrExpr
impl Debug for BlockStmtOrExpr
sourceimpl<'de> Deserialize<'de> for BlockStmtOrExpr
impl<'de> Deserialize<'de> for BlockStmtOrExpr
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl EqIgnoreSpan for BlockStmtOrExpr
impl EqIgnoreSpan for BlockStmtOrExpr
fn eq_ignore_span(&self, other: &Self) -> bool
sourceimpl From<BlockStmt> for BlockStmtOrExpr
impl From<BlockStmt> for BlockStmtOrExpr
sourceimpl<T> From<T> for BlockStmtOrExprwhere
T: Into<Expr>,
impl<T> From<T> for BlockStmtOrExprwhere
T: Into<Expr>,
sourceimpl Hash for BlockStmtOrExpr
impl Hash for BlockStmtOrExpr
sourceimpl PartialEq<BlockStmtOrExpr> for BlockStmtOrExpr
impl PartialEq<BlockStmtOrExpr> for BlockStmtOrExpr
sourcefn eq(&self, other: &BlockStmtOrExpr) -> bool
fn eq(&self, other: &BlockStmtOrExpr) -> bool
sourceimpl Serialize for BlockStmtOrExpr
impl Serialize for BlockStmtOrExpr
sourceimpl Spanned for BlockStmtOrExpr
impl Spanned for BlockStmtOrExpr
sourceimpl Take for BlockStmtOrExpr
impl Take for BlockStmtOrExpr
impl Eq for BlockStmtOrExpr
impl StructuralEq for BlockStmtOrExpr
impl StructuralPartialEq for BlockStmtOrExpr
Auto Trait Implementations
impl RefUnwindSafe for BlockStmtOrExpr
impl Send for BlockStmtOrExpr
impl Sync for BlockStmtOrExpr
impl Unpin for BlockStmtOrExpr
impl UnwindSafe for BlockStmtOrExpr
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more