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]

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]

Unwraps the value, yielding the content of Shorthand.

Panics

Panics if the value is not Shorthand, with a panic message including the content of self.

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]

Returns true if self is of variant KeyValue.

pub fn expect_key_value(self) -> KeyValueProp where
    Self: Debug
[src]

Unwraps the value, yielding the content of KeyValue.

Panics

Panics if the value is not KeyValue, with a panic message including the content of self.

pub fn key_value(self) -> Option<KeyValueProp>[src]

Returns Some if self is of variant KeyValue, and None otherwise.

pub fn is_assign(&self) -> bool[src]

Returns true if self is of variant Assign.

pub fn expect_assign(self) -> AssignProp where
    Self: Debug
[src]

Unwraps the value, yielding the content of Assign.

Panics

Panics if the value is not Assign, with a panic message including the content of self.

pub fn assign(self) -> Option<AssignProp>[src]

Returns Some if self is of variant Assign, and None otherwise.

pub fn is_getter(&self) -> bool[src]

Returns true if self is of variant Getter.

pub fn expect_getter(self) -> GetterProp where
    Self: Debug
[src]

Unwraps the value, yielding the content of Getter.

Panics

Panics if the value is not Getter, with a panic message including the content of self.

pub fn getter(self) -> Option<GetterProp>[src]

Returns Some if self is of variant Getter, and None otherwise.

pub fn is_setter(&self) -> bool[src]

Returns true if self is of variant Setter.

pub fn expect_setter(self) -> SetterProp where
    Self: Debug
[src]

Unwraps the value, yielding the content of Setter.

Panics

Panics if the value is not Setter, with a panic message including the content of self.

pub fn setter(self) -> Option<SetterProp>[src]

Returns Some if self is of variant Setter, and None otherwise.

pub fn is_method(&self) -> bool[src]

Returns true if self is of variant Method.

pub fn expect_method(self) -> MethodProp where
    Self: Debug
[src]

Unwraps the value, yielding the content of Method.

Panics

Panics if the value is not Method, with a panic message including the content of self.

pub fn method(self) -> Option<MethodProp>[src]

Returns Some if self is of variant Method, and None otherwise.

Trait Implementations

impl Clone for Prop[src]

impl Debug for Prop[src]

impl<'de> Deserialize<'de> for Prop[src]

impl Eq for Prop[src]

impl EqIgnoreSpan for Prop[src]

impl From<AssignProp> for Prop[src]

impl From<GetterProp> for Prop[src]

impl From<Ident> for Prop[src]

impl From<KeyValueProp> for Prop[src]

impl From<MethodProp> for Prop[src]

impl From<SetterProp> for Prop[src]

impl Hash for Prop[src]

impl PartialEq<Prop> for Prop[src]

impl Serialize for Prop[src]

impl Spanned 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> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Send for T where
    T: ?Sized
[src]

impl<T> Sync for T where
    T: ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.