Enum swc_ecma_ast::DefaultDecl
source · [−]pub enum DefaultDecl {
Class(ClassExpr),
Fn(FnExpr),
TsInterfaceDecl(Box<TsInterfaceDecl>),
}
Variants
Class(ClassExpr)
Fn(FnExpr)
TsInterfaceDecl(Box<TsInterfaceDecl>)
Implementations
sourceimpl DefaultDecl
impl DefaultDecl
sourcepub fn as_class(&self) -> Option<&ClassExpr>
pub fn as_class(&self) -> Option<&ClassExpr>
Returns Some
if self
is a reference of variant Class
, and None
otherwise.
sourcepub fn as_mut_class(&mut self) -> Option<&mut ClassExpr>
pub fn as_mut_class(&mut self) -> Option<&mut ClassExpr>
Returns Some
if self
is a mutable reference of variant Class
, and None
otherwise.
sourcepub fn expect_class(self) -> ClassExprwhere
Self: Debug,
pub fn expect_class(self) -> ClassExprwhere
Self: Debug,
sourcepub fn class(self) -> Option<ClassExpr>
pub fn class(self) -> Option<ClassExpr>
Returns Some
if self
is of variant Class
, and None
otherwise.
sourcepub fn is_fn_expr(&self) -> bool
pub fn is_fn_expr(&self) -> bool
Returns true
if self
is of variant Fn
.
sourcepub fn as_fn_expr(&self) -> Option<&FnExpr>
pub fn as_fn_expr(&self) -> Option<&FnExpr>
Returns Some
if self
is a reference of variant Fn
, and None
otherwise.
sourcepub fn as_mut_fn_expr(&mut self) -> Option<&mut FnExpr>
pub fn as_mut_fn_expr(&mut self) -> Option<&mut FnExpr>
Returns Some
if self
is a mutable reference of variant Fn
, and None
otherwise.
sourcepub fn expect_fn_expr(self) -> FnExprwhere
Self: Debug,
pub fn expect_fn_expr(self) -> FnExprwhere
Self: Debug,
sourcepub fn fn_expr(self) -> Option<FnExpr>
pub fn fn_expr(self) -> Option<FnExpr>
Returns Some
if self
is of variant Fn
, and None
otherwise.
sourcepub fn is_ts_interface_decl(&self) -> bool
pub fn is_ts_interface_decl(&self) -> bool
Returns true
if self
is of variant TsInterfaceDecl
.
sourcepub fn as_ts_interface_decl(&self) -> Option<&Box<TsInterfaceDecl>>
pub fn as_ts_interface_decl(&self) -> Option<&Box<TsInterfaceDecl>>
Returns Some
if self
is a reference of variant TsInterfaceDecl
, and None
otherwise.
sourcepub fn as_mut_ts_interface_decl(&mut self) -> Option<&mut Box<TsInterfaceDecl>>
pub fn as_mut_ts_interface_decl(&mut self) -> Option<&mut Box<TsInterfaceDecl>>
Returns Some
if self
is a mutable reference of variant TsInterfaceDecl
, and None
otherwise.
sourcepub fn expect_ts_interface_decl(self) -> Box<TsInterfaceDecl>where
Self: Debug,
pub fn expect_ts_interface_decl(self) -> Box<TsInterfaceDecl>where
Self: Debug,
Unwraps the value, yielding the content of TsInterfaceDecl
.
Panics
Panics if the value is not TsInterfaceDecl
, with a panic message including the content of self
.
sourcepub fn ts_interface_decl(self) -> Option<Box<TsInterfaceDecl>>
pub fn ts_interface_decl(self) -> Option<Box<TsInterfaceDecl>>
Returns Some
if self
is of variant TsInterfaceDecl
, and None
otherwise.
Trait Implementations
sourceimpl Clone for DefaultDecl
impl Clone for DefaultDecl
sourcefn clone(&self) -> DefaultDecl
fn clone(&self) -> DefaultDecl
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more