Enum swc_ecma_ast::TsTypeElement
source · [−]pub enum TsTypeElement {
TsCallSignatureDecl(TsCallSignatureDecl),
TsConstructSignatureDecl(TsConstructSignatureDecl),
TsPropertySignature(TsPropertySignature),
TsGetterSignature(TsGetterSignature),
TsSetterSignature(TsSetterSignature),
TsMethodSignature(TsMethodSignature),
TsIndexSignature(TsIndexSignature),
}
Variants
TsCallSignatureDecl(TsCallSignatureDecl)
TsConstructSignatureDecl(TsConstructSignatureDecl)
TsPropertySignature(TsPropertySignature)
TsGetterSignature(TsGetterSignature)
TsSetterSignature(TsSetterSignature)
TsMethodSignature(TsMethodSignature)
TsIndexSignature(TsIndexSignature)
Implementations
sourceimpl TsTypeElement
impl TsTypeElement
sourcepub fn is_ts_call_signature_decl(&self) -> bool
pub fn is_ts_call_signature_decl(&self) -> bool
Returns true
if self
is of variant TsCallSignatureDecl
.
sourcepub fn as_ts_call_signature_decl(&self) -> Option<&TsCallSignatureDecl>
pub fn as_ts_call_signature_decl(&self) -> Option<&TsCallSignatureDecl>
Returns Some
if self
is a reference of variant TsCallSignatureDecl
, and None
otherwise.
sourcepub fn as_mut_ts_call_signature_decl(
&mut self
) -> Option<&mut TsCallSignatureDecl>
pub fn as_mut_ts_call_signature_decl(
&mut self
) -> Option<&mut TsCallSignatureDecl>
Returns Some
if self
is a mutable reference of variant TsCallSignatureDecl
, and None
otherwise.
sourcepub fn expect_ts_call_signature_decl(self) -> TsCallSignatureDeclwhere
Self: Debug,
pub fn expect_ts_call_signature_decl(self) -> TsCallSignatureDeclwhere
Self: Debug,
Unwraps the value, yielding the content of TsCallSignatureDecl
.
Panics
Panics if the value is not TsCallSignatureDecl
, with a panic message including the content of self
.
sourcepub fn ts_call_signature_decl(self) -> Option<TsCallSignatureDecl>
pub fn ts_call_signature_decl(self) -> Option<TsCallSignatureDecl>
Returns Some
if self
is of variant TsCallSignatureDecl
, and None
otherwise.
sourcepub fn is_ts_construct_signature_decl(&self) -> bool
pub fn is_ts_construct_signature_decl(&self) -> bool
Returns true
if self
is of variant TsConstructSignatureDecl
.
sourcepub fn as_ts_construct_signature_decl(
&self
) -> Option<&TsConstructSignatureDecl>
pub fn as_ts_construct_signature_decl(
&self
) -> Option<&TsConstructSignatureDecl>
Returns Some
if self
is a reference of variant TsConstructSignatureDecl
, and None
otherwise.
sourcepub fn as_mut_ts_construct_signature_decl(
&mut self
) -> Option<&mut TsConstructSignatureDecl>
pub fn as_mut_ts_construct_signature_decl(
&mut self
) -> Option<&mut TsConstructSignatureDecl>
Returns Some
if self
is a mutable reference of variant TsConstructSignatureDecl
, and None
otherwise.
sourcepub fn expect_ts_construct_signature_decl(self) -> TsConstructSignatureDeclwhere
Self: Debug,
pub fn expect_ts_construct_signature_decl(self) -> TsConstructSignatureDeclwhere
Self: Debug,
Unwraps the value, yielding the content of TsConstructSignatureDecl
.
Panics
Panics if the value is not TsConstructSignatureDecl
, with a panic message including the content of self
.
sourcepub fn ts_construct_signature_decl(self) -> Option<TsConstructSignatureDecl>
pub fn ts_construct_signature_decl(self) -> Option<TsConstructSignatureDecl>
Returns Some
if self
is of variant TsConstructSignatureDecl
, and None
otherwise.
sourcepub fn is_ts_property_signature(&self) -> bool
pub fn is_ts_property_signature(&self) -> bool
Returns true
if self
is of variant TsPropertySignature
.
sourcepub fn as_ts_property_signature(&self) -> Option<&TsPropertySignature>
pub fn as_ts_property_signature(&self) -> Option<&TsPropertySignature>
Returns Some
if self
is a reference of variant TsPropertySignature
, and None
otherwise.
sourcepub fn as_mut_ts_property_signature(
&mut self
) -> Option<&mut TsPropertySignature>
pub fn as_mut_ts_property_signature(
&mut self
) -> Option<&mut TsPropertySignature>
Returns Some
if self
is a mutable reference of variant TsPropertySignature
, and None
otherwise.
sourcepub fn expect_ts_property_signature(self) -> TsPropertySignaturewhere
Self: Debug,
pub fn expect_ts_property_signature(self) -> TsPropertySignaturewhere
Self: Debug,
Unwraps the value, yielding the content of TsPropertySignature
.
Panics
Panics if the value is not TsPropertySignature
, with a panic message including the content of self
.
sourcepub fn ts_property_signature(self) -> Option<TsPropertySignature>
pub fn ts_property_signature(self) -> Option<TsPropertySignature>
Returns Some
if self
is of variant TsPropertySignature
, and None
otherwise.
sourcepub fn is_ts_getter_signature(&self) -> bool
pub fn is_ts_getter_signature(&self) -> bool
Returns true
if self
is of variant TsGetterSignature
.
sourcepub fn as_ts_getter_signature(&self) -> Option<&TsGetterSignature>
pub fn as_ts_getter_signature(&self) -> Option<&TsGetterSignature>
Returns Some
if self
is a reference of variant TsGetterSignature
, and None
otherwise.
sourcepub fn as_mut_ts_getter_signature(&mut self) -> Option<&mut TsGetterSignature>
pub fn as_mut_ts_getter_signature(&mut self) -> Option<&mut TsGetterSignature>
Returns Some
if self
is a mutable reference of variant TsGetterSignature
, and None
otherwise.
sourcepub fn expect_ts_getter_signature(self) -> TsGetterSignaturewhere
Self: Debug,
pub fn expect_ts_getter_signature(self) -> TsGetterSignaturewhere
Self: Debug,
Unwraps the value, yielding the content of TsGetterSignature
.
Panics
Panics if the value is not TsGetterSignature
, with a panic message including the content of self
.
sourcepub fn ts_getter_signature(self) -> Option<TsGetterSignature>
pub fn ts_getter_signature(self) -> Option<TsGetterSignature>
Returns Some
if self
is of variant TsGetterSignature
, and None
otherwise.
sourcepub fn is_ts_setter_signature(&self) -> bool
pub fn is_ts_setter_signature(&self) -> bool
Returns true
if self
is of variant TsSetterSignature
.
sourcepub fn as_ts_setter_signature(&self) -> Option<&TsSetterSignature>
pub fn as_ts_setter_signature(&self) -> Option<&TsSetterSignature>
Returns Some
if self
is a reference of variant TsSetterSignature
, and None
otherwise.
sourcepub fn as_mut_ts_setter_signature(&mut self) -> Option<&mut TsSetterSignature>
pub fn as_mut_ts_setter_signature(&mut self) -> Option<&mut TsSetterSignature>
Returns Some
if self
is a mutable reference of variant TsSetterSignature
, and None
otherwise.
sourcepub fn expect_ts_setter_signature(self) -> TsSetterSignaturewhere
Self: Debug,
pub fn expect_ts_setter_signature(self) -> TsSetterSignaturewhere
Self: Debug,
Unwraps the value, yielding the content of TsSetterSignature
.
Panics
Panics if the value is not TsSetterSignature
, with a panic message including the content of self
.
sourcepub fn ts_setter_signature(self) -> Option<TsSetterSignature>
pub fn ts_setter_signature(self) -> Option<TsSetterSignature>
Returns Some
if self
is of variant TsSetterSignature
, and None
otherwise.
sourcepub fn is_ts_method_signature(&self) -> bool
pub fn is_ts_method_signature(&self) -> bool
Returns true
if self
is of variant TsMethodSignature
.
sourcepub fn as_ts_method_signature(&self) -> Option<&TsMethodSignature>
pub fn as_ts_method_signature(&self) -> Option<&TsMethodSignature>
Returns Some
if self
is a reference of variant TsMethodSignature
, and None
otherwise.
sourcepub fn as_mut_ts_method_signature(&mut self) -> Option<&mut TsMethodSignature>
pub fn as_mut_ts_method_signature(&mut self) -> Option<&mut TsMethodSignature>
Returns Some
if self
is a mutable reference of variant TsMethodSignature
, and None
otherwise.
sourcepub fn expect_ts_method_signature(self) -> TsMethodSignaturewhere
Self: Debug,
pub fn expect_ts_method_signature(self) -> TsMethodSignaturewhere
Self: Debug,
Unwraps the value, yielding the content of TsMethodSignature
.
Panics
Panics if the value is not TsMethodSignature
, with a panic message including the content of self
.
sourcepub fn ts_method_signature(self) -> Option<TsMethodSignature>
pub fn ts_method_signature(self) -> Option<TsMethodSignature>
Returns Some
if self
is of variant TsMethodSignature
, 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.
Trait Implementations
sourceimpl Clone for TsTypeElement
impl Clone for TsTypeElement
sourcefn clone(&self) -> TsTypeElement
fn clone(&self) -> TsTypeElement
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more