[−][src]Enum swc_ecma_ast::Prop
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]
Self: Debug,
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]
Self: Debug,
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]
Self: Debug,
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]
Self: Debug,
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]
Self: Debug,
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]
Self: Debug,
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]
fn deserialize<D>(Deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
impl Eq for Prop
[src]
impl From<AssignProp> for Prop
[src]
fn from(v: AssignProp) -> Self
[src]
impl From<GetterProp> for Prop
[src]
fn from(v: GetterProp) -> Self
[src]
impl From<Ident> for Prop
[src]
impl From<KeyValueProp> for Prop
[src]
fn from(v: KeyValueProp) -> Self
[src]
impl From<MethodProp> for Prop
[src]
fn from(v: MethodProp) -> Self
[src]
impl From<SetterProp> for Prop
[src]
fn from(v: SetterProp) -> Self
[src]
impl Hash for Prop
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<Prop> for Prop
[src]
impl Serialize for Prop
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Send for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Sync for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,