Enum swc_ecma_ast::MemberProp
source · [−]pub enum MemberProp {
Ident(Ident),
PrivateName(PrivateName),
Computed(ComputedPropName),
}
Variants
Ident(Ident)
PrivateName(PrivateName)
Computed(ComputedPropName)
Implementations
sourceimpl MemberProp
impl MemberProp
sourcepub fn as_ident(&self) -> Option<&Ident>
pub fn as_ident(&self) -> Option<&Ident>
Returns Some
if self
is a reference of variant Ident
, and None
otherwise.
sourcepub fn as_mut_ident(&mut self) -> Option<&mut Ident>
pub fn as_mut_ident(&mut self) -> Option<&mut Ident>
Returns Some
if self
is a mutable reference of variant Ident
, and None
otherwise.
sourcepub fn expect_ident(self) -> Identwhere
Self: Debug,
pub fn expect_ident(self) -> Identwhere
Self: Debug,
sourcepub fn ident(self) -> Option<Ident>
pub fn ident(self) -> Option<Ident>
Returns Some
if self
is of variant Ident
, and None
otherwise.
sourcepub fn is_private_name(&self) -> bool
pub fn is_private_name(&self) -> bool
Returns true
if self
is of variant PrivateName
.
sourcepub fn as_private_name(&self) -> Option<&PrivateName>
pub fn as_private_name(&self) -> Option<&PrivateName>
Returns Some
if self
is a reference of variant PrivateName
, and None
otherwise.
sourcepub fn as_mut_private_name(&mut self) -> Option<&mut PrivateName>
pub fn as_mut_private_name(&mut self) -> Option<&mut PrivateName>
Returns Some
if self
is a mutable reference of variant PrivateName
, and None
otherwise.
sourcepub fn expect_private_name(self) -> PrivateNamewhere
Self: Debug,
pub fn expect_private_name(self) -> PrivateNamewhere
Self: Debug,
Unwraps the value, yielding the content of PrivateName
.
Panics
Panics if the value is not PrivateName
, with a panic message including the content of self
.
sourcepub fn private_name(self) -> Option<PrivateName>
pub fn private_name(self) -> Option<PrivateName>
Returns Some
if self
is of variant PrivateName
, and None
otherwise.
sourcepub fn is_computed(&self) -> bool
pub fn is_computed(&self) -> bool
Returns true
if self
is of variant Computed
.
sourcepub fn as_computed(&self) -> Option<&ComputedPropName>
pub fn as_computed(&self) -> Option<&ComputedPropName>
Returns Some
if self
is a reference of variant Computed
, and None
otherwise.
sourcepub fn as_mut_computed(&mut self) -> Option<&mut ComputedPropName>
pub fn as_mut_computed(&mut self) -> Option<&mut ComputedPropName>
Returns Some
if self
is a mutable reference of variant Computed
, and None
otherwise.
sourcepub fn expect_computed(self) -> ComputedPropNamewhere
Self: Debug,
pub fn expect_computed(self) -> ComputedPropNamewhere
Self: Debug,
sourcepub fn computed(self) -> Option<ComputedPropName>
pub fn computed(self) -> Option<ComputedPropName>
Returns Some
if self
is of variant Computed
, and None
otherwise.
Trait Implementations
sourceimpl Clone for MemberProp
impl Clone for MemberProp
sourcefn clone(&self) -> MemberProp
fn clone(&self) -> MemberProp
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more