Enum swc_ecma_ast::ClassMember
source · [−]pub enum ClassMember {
Constructor(Constructor),
Method(ClassMethod),
PrivateMethod(PrivateMethod),
ClassProp(ClassProp),
PrivateProp(PrivateProp),
TsIndexSignature(TsIndexSignature),
Empty(EmptyStmt),
StaticBlock(StaticBlock),
}
Variants
Constructor(Constructor)
Method(ClassMethod)
es2015
PrivateMethod(PrivateMethod)
ClassProp(ClassProp)
stage 0 / Typescript
PrivateProp(PrivateProp)
TsIndexSignature(TsIndexSignature)
Empty(EmptyStmt)
StaticBlock(StaticBlock)
Implementations
sourceimpl ClassMember
impl ClassMember
sourcepub fn is_constructor(&self) -> bool
pub fn is_constructor(&self) -> bool
Returns true
if self
is of variant Constructor
.
sourcepub fn as_constructor(&self) -> Option<&Constructor>
pub fn as_constructor(&self) -> Option<&Constructor>
Returns Some
if self
is a reference of variant Constructor
, and None
otherwise.
sourcepub fn as_mut_constructor(&mut self) -> Option<&mut Constructor>
pub fn as_mut_constructor(&mut self) -> Option<&mut Constructor>
Returns Some
if self
is a mutable reference of variant Constructor
, and None
otherwise.
sourcepub fn expect_constructor(self) -> Constructorwhere
Self: Debug,
pub fn expect_constructor(self) -> Constructorwhere
Self: Debug,
Unwraps the value, yielding the content of Constructor
.
Panics
Panics if the value is not Constructor
, with a panic message including the content of self
.
sourcepub fn constructor(self) -> Option<Constructor>
pub fn constructor(self) -> Option<Constructor>
Returns Some
if self
is of variant Constructor
, and None
otherwise.
sourcepub fn as_method(&self) -> Option<&ClassMethod>
pub fn as_method(&self) -> Option<&ClassMethod>
Returns Some
if self
is a reference of variant Method
, and None
otherwise.
sourcepub fn as_mut_method(&mut self) -> Option<&mut ClassMethod>
pub fn as_mut_method(&mut self) -> Option<&mut ClassMethod>
Returns Some
if self
is a mutable reference of variant Method
, and None
otherwise.
sourcepub fn expect_method(self) -> ClassMethodwhere
Self: Debug,
pub fn expect_method(self) -> ClassMethodwhere
Self: Debug,
sourcepub fn method(self) -> Option<ClassMethod>
pub fn method(self) -> Option<ClassMethod>
Returns Some
if self
is of variant Method
, and None
otherwise.
sourcepub fn is_private_method(&self) -> bool
pub fn is_private_method(&self) -> bool
Returns true
if self
is of variant PrivateMethod
.
sourcepub fn as_private_method(&self) -> Option<&PrivateMethod>
pub fn as_private_method(&self) -> Option<&PrivateMethod>
Returns Some
if self
is a reference of variant PrivateMethod
, and None
otherwise.
sourcepub fn as_mut_private_method(&mut self) -> Option<&mut PrivateMethod>
pub fn as_mut_private_method(&mut self) -> Option<&mut PrivateMethod>
Returns Some
if self
is a mutable reference of variant PrivateMethod
, and None
otherwise.
sourcepub fn expect_private_method(self) -> PrivateMethodwhere
Self: Debug,
pub fn expect_private_method(self) -> PrivateMethodwhere
Self: Debug,
Unwraps the value, yielding the content of PrivateMethod
.
Panics
Panics if the value is not PrivateMethod
, with a panic message including the content of self
.
sourcepub fn private_method(self) -> Option<PrivateMethod>
pub fn private_method(self) -> Option<PrivateMethod>
Returns Some
if self
is of variant PrivateMethod
, and None
otherwise.
sourcepub fn is_class_prop(&self) -> bool
pub fn is_class_prop(&self) -> bool
Returns true
if self
is of variant ClassProp
.
sourcepub fn as_class_prop(&self) -> Option<&ClassProp>
pub fn as_class_prop(&self) -> Option<&ClassProp>
Returns Some
if self
is a reference of variant ClassProp
, and None
otherwise.
sourcepub fn as_mut_class_prop(&mut self) -> Option<&mut ClassProp>
pub fn as_mut_class_prop(&mut self) -> Option<&mut ClassProp>
Returns Some
if self
is a mutable reference of variant ClassProp
, and None
otherwise.
sourcepub fn expect_class_prop(self) -> ClassPropwhere
Self: Debug,
pub fn expect_class_prop(self) -> ClassPropwhere
Self: Debug,
sourcepub fn class_prop(self) -> Option<ClassProp>
pub fn class_prop(self) -> Option<ClassProp>
Returns Some
if self
is of variant ClassProp
, and None
otherwise.
sourcepub fn is_private_prop(&self) -> bool
pub fn is_private_prop(&self) -> bool
Returns true
if self
is of variant PrivateProp
.
sourcepub fn as_private_prop(&self) -> Option<&PrivateProp>
pub fn as_private_prop(&self) -> Option<&PrivateProp>
Returns Some
if self
is a reference of variant PrivateProp
, and None
otherwise.
sourcepub fn as_mut_private_prop(&mut self) -> Option<&mut PrivateProp>
pub fn as_mut_private_prop(&mut self) -> Option<&mut PrivateProp>
Returns Some
if self
is a mutable reference of variant PrivateProp
, and None
otherwise.
sourcepub fn expect_private_prop(self) -> PrivatePropwhere
Self: Debug,
pub fn expect_private_prop(self) -> PrivatePropwhere
Self: Debug,
Unwraps the value, yielding the content of PrivateProp
.
Panics
Panics if the value is not PrivateProp
, with a panic message including the content of self
.
sourcepub fn private_prop(self) -> Option<PrivateProp>
pub fn private_prop(self) -> Option<PrivateProp>
Returns Some
if self
is of variant PrivateProp
, and None
otherwise.
sourcepub fn is_ts_index_signature(&self) -> bool
pub fn is_ts_index_signature(&self) -> bool
Returns true
if self
is of variant TsIndexSignature
.
sourcepub fn as_ts_index_signature(&self) -> Option<&TsIndexSignature>
pub fn as_ts_index_signature(&self) -> Option<&TsIndexSignature>
Returns Some
if self
is a reference of variant TsIndexSignature
, and None
otherwise.
sourcepub fn as_mut_ts_index_signature(&mut self) -> Option<&mut TsIndexSignature>
pub fn as_mut_ts_index_signature(&mut self) -> Option<&mut TsIndexSignature>
Returns Some
if self
is a mutable reference of variant TsIndexSignature
, and None
otherwise.
sourcepub fn expect_ts_index_signature(self) -> TsIndexSignaturewhere
Self: Debug,
pub fn expect_ts_index_signature(self) -> TsIndexSignaturewhere
Self: Debug,
Unwraps the value, yielding the content of TsIndexSignature
.
Panics
Panics if the value is not TsIndexSignature
, with a panic message including the content of self
.
sourcepub fn ts_index_signature(self) -> Option<TsIndexSignature>
pub fn ts_index_signature(self) -> Option<TsIndexSignature>
Returns Some
if self
is of variant TsIndexSignature
, and None
otherwise.
sourcepub fn as_empty(&self) -> Option<&EmptyStmt>
pub fn as_empty(&self) -> Option<&EmptyStmt>
Returns Some
if self
is a reference of variant Empty
, and None
otherwise.
sourcepub fn as_mut_empty(&mut self) -> Option<&mut EmptyStmt>
pub fn as_mut_empty(&mut self) -> Option<&mut EmptyStmt>
Returns Some
if self
is a mutable reference of variant Empty
, and None
otherwise.
sourcepub fn expect_empty(self) -> EmptyStmtwhere
Self: Debug,
pub fn expect_empty(self) -> EmptyStmtwhere
Self: Debug,
sourcepub fn empty(self) -> Option<EmptyStmt>
pub fn empty(self) -> Option<EmptyStmt>
Returns Some
if self
is of variant Empty
, and None
otherwise.
sourcepub fn is_static_block(&self) -> bool
pub fn is_static_block(&self) -> bool
Returns true
if self
is of variant StaticBlock
.
sourcepub fn as_static_block(&self) -> Option<&StaticBlock>
pub fn as_static_block(&self) -> Option<&StaticBlock>
Returns Some
if self
is a reference of variant StaticBlock
, and None
otherwise.
sourcepub fn as_mut_static_block(&mut self) -> Option<&mut StaticBlock>
pub fn as_mut_static_block(&mut self) -> Option<&mut StaticBlock>
Returns Some
if self
is a mutable reference of variant StaticBlock
, and None
otherwise.
sourcepub fn expect_static_block(self) -> StaticBlockwhere
Self: Debug,
pub fn expect_static_block(self) -> StaticBlockwhere
Self: Debug,
Unwraps the value, yielding the content of StaticBlock
.
Panics
Panics if the value is not StaticBlock
, with a panic message including the content of self
.
sourcepub fn static_block(self) -> Option<StaticBlock>
pub fn static_block(self) -> Option<StaticBlock>
Returns Some
if self
is of variant StaticBlock
, and None
otherwise.
Trait Implementations
sourceimpl Clone for ClassMember
impl Clone for ClassMember
sourcefn clone(&self) -> ClassMember
fn clone(&self) -> ClassMember
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more