Enum swc_ecma_ast::VarDeclOrExpr
source · [−]Variants
VarDecl(Box<VarDecl>)
Expr(Box<Expr>)
Implementations
sourceimpl VarDeclOrExpr
impl VarDeclOrExpr
sourcepub fn is_var_decl(&self) -> bool
pub fn is_var_decl(&self) -> bool
Returns true
if self
is of variant VarDecl
.
sourcepub fn as_var_decl(&self) -> Option<&Box<VarDecl>>
pub fn as_var_decl(&self) -> Option<&Box<VarDecl>>
Returns Some
if self
is a reference of variant VarDecl
, and None
otherwise.
sourcepub fn as_mut_var_decl(&mut self) -> Option<&mut Box<VarDecl>>
pub fn as_mut_var_decl(&mut self) -> Option<&mut Box<VarDecl>>
Returns Some
if self
is a mutable reference of variant VarDecl
, and None
otherwise.
sourcepub fn expect_var_decl(self) -> Box<VarDecl>where
Self: Debug,
pub fn expect_var_decl(self) -> Box<VarDecl>where
Self: Debug,
sourcepub fn var_decl(self) -> Option<Box<VarDecl>>
pub fn var_decl(self) -> Option<Box<VarDecl>>
Returns Some
if self
is of variant VarDecl
, 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 VarDeclOrExpr
impl Clone for VarDeclOrExpr
sourcefn clone(&self) -> VarDeclOrExpr
fn clone(&self) -> VarDeclOrExpr
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 VarDeclOrExpr
impl Debug for VarDeclOrExpr
sourceimpl<'de> Deserialize<'de> for VarDeclOrExpr
impl<'de> Deserialize<'de> for VarDeclOrExpr
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 VarDeclOrExpr
impl EqIgnoreSpan for VarDeclOrExpr
fn eq_ignore_span(&self, other: &Self) -> bool
sourceimpl From<Expr> for VarDeclOrExpr
impl From<Expr> for VarDeclOrExpr
sourcefn from(src: Expr) -> VarDeclOrExpr
fn from(src: Expr) -> VarDeclOrExpr
Converts to this type from the input type.
sourceimpl From<VarDecl> for VarDeclOrExpr
impl From<VarDecl> for VarDeclOrExpr
sourcefn from(src: VarDecl) -> VarDeclOrExpr
fn from(src: VarDecl) -> VarDeclOrExpr
Converts to this type from the input type.
sourceimpl Hash for VarDeclOrExpr
impl Hash for VarDeclOrExpr
sourceimpl PartialEq<VarDeclOrExpr> for VarDeclOrExpr
impl PartialEq<VarDeclOrExpr> for VarDeclOrExpr
sourcefn eq(&self, other: &VarDeclOrExpr) -> bool
fn eq(&self, other: &VarDeclOrExpr) -> bool
sourceimpl Serialize for VarDeclOrExpr
impl Serialize for VarDeclOrExpr
sourceimpl Spanned for VarDeclOrExpr
impl Spanned for VarDeclOrExpr
sourceimpl Take for VarDeclOrExpr
impl Take for VarDeclOrExpr
impl Eq for VarDeclOrExpr
impl StructuralEq for VarDeclOrExpr
impl StructuralPartialEq for VarDeclOrExpr
Auto Trait Implementations
impl RefUnwindSafe for VarDeclOrExpr
impl Send for VarDeclOrExpr
impl Sync for VarDeclOrExpr
impl Unpin for VarDeclOrExpr
impl UnwindSafe for VarDeclOrExpr
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