Enum swc_ecma_ast::Prop [−][src]
pub enum Prop { Shorthand(Ident), KeyValue(KeyValueProp), Assign(AssignProp), Getter(GetterProp), Setter(SetterProp), Method(MethodProp), }
Variants
Shorthand(Ident)
a
in { a, }
KeyValue(KeyValueProp)
key: value
in { key: value, }
Assign(AssignProp)
This is invalid for object literal.
Getter(GetterProp)
Setter(SetterProp)
Method(MethodProp)
Implementations
impl Prop
[src]
impl Prop
[src]pub fn is_shorthand(&self) -> bool
[src]
pub fn is_shorthand(&self) -> bool
[src]Returns true
if self
is of variant Shorthand
.
pub fn expect_shorthand(self) -> Ident where
Self: Debug,
[src]
pub fn expect_shorthand(self) -> Ident where
Self: Debug,
[src]pub fn shorthand(self) -> Option<Ident>
[src]
pub fn shorthand(self) -> Option<Ident>
[src]Returns Some
if self
is of variant Shorthand
, and None
otherwise.
pub fn is_key_value(&self) -> bool
[src]
pub fn is_key_value(&self) -> bool
[src]Returns true
if self
is of variant KeyValue
.
pub fn expect_key_value(self) -> KeyValueProp where
Self: Debug,
[src]
pub fn expect_key_value(self) -> KeyValueProp where
Self: Debug,
[src]pub fn key_value(self) -> Option<KeyValueProp>
[src]
pub fn key_value(self) -> Option<KeyValueProp>
[src]Returns Some
if self
is of variant KeyValue
, and None
otherwise.
pub fn expect_assign(self) -> AssignProp where
Self: Debug,
[src]
pub fn expect_assign(self) -> AssignProp where
Self: Debug,
[src]pub fn assign(self) -> Option<AssignProp>
[src]
pub fn assign(self) -> Option<AssignProp>
[src]Returns Some
if self
is of variant Assign
, and None
otherwise.
pub fn expect_getter(self) -> GetterProp where
Self: Debug,
[src]
pub fn expect_getter(self) -> GetterProp where
Self: Debug,
[src]pub fn getter(self) -> Option<GetterProp>
[src]
pub fn getter(self) -> Option<GetterProp>
[src]Returns Some
if self
is of variant Getter
, and None
otherwise.
pub fn expect_setter(self) -> SetterProp where
Self: Debug,
[src]
pub fn expect_setter(self) -> SetterProp where
Self: Debug,
[src]pub fn setter(self) -> Option<SetterProp>
[src]
pub fn setter(self) -> Option<SetterProp>
[src]Returns Some
if self
is of variant Setter
, and None
otherwise.
pub fn expect_method(self) -> MethodProp where
Self: Debug,
[src]
pub fn expect_method(self) -> MethodProp where
Self: Debug,
[src]pub fn method(self) -> Option<MethodProp>
[src]
pub fn method(self) -> Option<MethodProp>
[src]Returns Some
if self
is of variant Method
, and None
otherwise.
Trait Implementations
impl<'de> Deserialize<'de> for Prop
[src]
impl<'de> Deserialize<'de> for Prop
[src]fn deserialize<D>(Deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
fn deserialize<D>(Deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]Deserialize this value from the given Serde deserializer. Read more
impl EqIgnoreSpan for Prop
[src]
impl EqIgnoreSpan for Prop
[src]fn eq_ignore_span(&self, other: &Self) -> bool
[src]
impl From<AssignProp> for Prop
[src]
impl From<AssignProp> for Prop
[src]fn from(v: AssignProp) -> Self
[src]
fn from(v: AssignProp) -> Self
[src]Performs the conversion.
impl From<GetterProp> for Prop
[src]
impl From<GetterProp> for Prop
[src]fn from(v: GetterProp) -> Self
[src]
fn from(v: GetterProp) -> Self
[src]Performs the conversion.
impl From<KeyValueProp> for Prop
[src]
impl From<KeyValueProp> for Prop
[src]fn from(v: KeyValueProp) -> Self
[src]
fn from(v: KeyValueProp) -> Self
[src]Performs the conversion.
impl From<MethodProp> for Prop
[src]
impl From<MethodProp> for Prop
[src]fn from(v: MethodProp) -> Self
[src]
fn from(v: MethodProp) -> Self
[src]Performs the conversion.
impl From<SetterProp> for Prop
[src]
impl From<SetterProp> for Prop
[src]fn from(v: SetterProp) -> Self
[src]
fn from(v: SetterProp) -> Self
[src]Performs the conversion.
impl Eq for Prop
[src]
impl StructuralEq for Prop
[src]
impl StructuralPartialEq for Prop
[src]
Auto Trait Implementations
impl RefUnwindSafe for Prop
impl Send for Prop
impl Sync for Prop
impl Unpin for Prop
impl UnwindSafe for Prop
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> Send for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Sync for T where
T: ?Sized,
[src]
T: ?Sized,