Enum swc_ecma_ast::PropOrSpread [−][src]
Variants
Spread(SpreadElement)
Spread properties, e.g., {a: 1, ...obj, b: 2}
.
Implementations
impl PropOrSpread
[src]
pub fn is_spread(&self) -> bool
[src]
Returns true
if self
is of variant Spread
.
pub fn expect_spread(self) -> SpreadElement where
Self: Debug,
[src]
Self: Debug,
Unwraps the value, yielding the content of Spread
.
Panics
Panics if the value is not Spread
, with a panic message including the content of self
.
pub fn spread(self) -> Option<SpreadElement>
[src]
Returns Some
if self
is of variant Spread
, and None
otherwise.
pub fn is_prop(&self) -> bool
[src]
Returns true
if self
is of variant Prop
.
pub fn expect_prop(self) -> Box<Prop> where
Self: Debug,
[src]
Self: Debug,
Unwraps the value, yielding the content of Prop
.
Panics
Panics if the value is not Prop
, with a panic message including the content of self
.
pub fn prop(self) -> Option<Box<Prop>>
[src]
Returns Some
if self
is of variant Prop
, and None
otherwise.
Trait Implementations
impl Clone for PropOrSpread
[src]
fn clone(&self) -> PropOrSpread
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for PropOrSpread
[src]
impl<'de> Deserialize<'de> for PropOrSpread
[src]
fn deserialize<D>(Deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
impl Eq for PropOrSpread
[src]
impl EqIgnoreSpan for PropOrSpread
[src]
fn eq_ignore_span(&self, other: &Self) -> bool
[src]
impl From<Box<Prop, Global>> for PropOrSpread
[src]
impl From<SpreadElement> for PropOrSpread
[src]
fn from(v: SpreadElement) -> Self
[src]
impl Hash for PropOrSpread
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<PropOrSpread> for PropOrSpread
[src]
fn eq(&self, other: &PropOrSpread) -> bool
[src]
fn ne(&self, other: &PropOrSpread) -> bool
[src]
impl Serialize for PropOrSpread
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl Spanned for PropOrSpread
[src]
impl StructuralEq for PropOrSpread
[src]
impl StructuralPartialEq for PropOrSpread
[src]
Auto Trait Implementations
impl RefUnwindSafe for PropOrSpread
impl Send for PropOrSpread
impl Sync for PropOrSpread
impl Unpin for PropOrSpread
impl UnwindSafe for PropOrSpread
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,
pub 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.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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>,