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 Archive for MemberProp
impl Archive for MemberProp
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 moresourceimpl Debug for MemberProp
impl Debug for MemberProp
sourceimpl<'de> Deserialize<'de> for MemberProp
impl<'de> Deserialize<'de> for MemberProp
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>,
sourceimpl<__D: Fallible + ?Sized> Deserialize<MemberProp, __D> for Archived<MemberProp>where
__D: SharedDeserializeRegistry,
impl<__D: Fallible + ?Sized> Deserialize<MemberProp, __D> for Archived<MemberProp>where
__D: SharedDeserializeRegistry,
sourcefn deserialize(&self, deserializer: &mut __D) -> Result<MemberProp, __D::Error>
fn deserialize(&self, deserializer: &mut __D) -> Result<MemberProp, __D::Error>
sourceimpl EqIgnoreSpan for MemberProp
impl EqIgnoreSpan for MemberProp
fn eq_ignore_span(&self, other: &Self) -> bool
sourceimpl From<ComputedPropName> for MemberProp
impl From<ComputedPropName> for MemberProp
sourcefn from(v: ComputedPropName) -> Self
fn from(v: ComputedPropName) -> Self
sourceimpl From<Ident> for MemberProp
impl From<Ident> for MemberProp
sourceimpl From<PrivateName> for MemberProp
impl From<PrivateName> for MemberProp
sourcefn from(v: PrivateName) -> Self
fn from(v: PrivateName) -> Self
sourceimpl From<PropName> for MemberProp
impl From<PropName> for MemberProp
sourceimpl Hash for MemberProp
impl Hash for MemberProp
sourceimpl PartialEq<MemberProp> for MemberProp
impl PartialEq<MemberProp> for MemberProp
sourcefn eq(&self, other: &MemberProp) -> bool
fn eq(&self, other: &MemberProp) -> bool
sourceimpl<__S: Fallible + ?Sized> Serialize<__S> for MemberPropwhere
__S: Serializer + ScratchSpace + SharedSerializeRegistry,
impl<__S: Fallible + ?Sized> Serialize<__S> for MemberPropwhere
__S: Serializer + ScratchSpace + SharedSerializeRegistry,
sourceimpl Serialize for MemberProp
impl Serialize for MemberProp
sourceimpl Spanned for MemberProp
impl Spanned for MemberProp
sourceimpl Take for MemberProp
impl Take for MemberProp
impl Eq for MemberProp
impl StructuralEq for MemberProp
impl StructuralPartialEq for MemberProp
Auto Trait Implementations
impl RefUnwindSafe for MemberProp
impl Send for MemberProp
impl Sync for MemberProp
impl Unpin for MemberProp
impl UnwindSafe for MemberProp
Blanket Implementations
sourceimpl<T> ArchivePointee for T
impl<T> ArchivePointee for T
type ArchivedMetadata = ()
type ArchivedMetadata = ()
sourcefn pointer_metadata(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
sourceimpl<T> ArchiveUnsized for Twhere
T: Archive,
impl<T> ArchiveUnsized for Twhere
T: Archive,
type Archived = <T as Archive>::Archived
type Archived = <T as Archive>::Archived
Archive
, it may be unsized. Read more