Enum swc_ecma_ast::PropOrSpread
source · [−]pub enum PropOrSpread {
Spread(SpreadElement),
Prop(Box<Prop>),
}
Variants
Spread(SpreadElement)
Spread properties, e.g., {a: 1, ...obj, b: 2}
.
Prop(Box<Prop>)
Implementations
sourceimpl PropOrSpread
impl PropOrSpread
sourcepub fn as_spread(&self) -> Option<&SpreadElement>
pub fn as_spread(&self) -> Option<&SpreadElement>
Returns Some
if self
is a reference of variant Spread
, and None
otherwise.
sourcepub fn as_mut_spread(&mut self) -> Option<&mut SpreadElement>
pub fn as_mut_spread(&mut self) -> Option<&mut SpreadElement>
Returns Some
if self
is a mutable reference of variant Spread
, and None
otherwise.
sourcepub fn expect_spread(self) -> SpreadElementwhere
Self: Debug,
pub fn expect_spread(self) -> SpreadElementwhere
Self: Debug,
sourcepub fn spread(self) -> Option<SpreadElement>
pub fn spread(self) -> Option<SpreadElement>
Returns Some
if self
is of variant Spread
, and None
otherwise.
sourcepub fn as_prop(&self) -> Option<&Box<Prop>>
pub fn as_prop(&self) -> Option<&Box<Prop>>
Returns Some
if self
is a reference of variant Prop
, and None
otherwise.
sourcepub fn as_mut_prop(&mut self) -> Option<&mut Box<Prop>>
pub fn as_mut_prop(&mut self) -> Option<&mut Box<Prop>>
Returns Some
if self
is a mutable reference of variant Prop
, and None
otherwise.
sourcepub fn expect_prop(self) -> Box<Prop>where
Self: Debug,
pub fn expect_prop(self) -> Box<Prop>where
Self: Debug,
Trait Implementations
sourceimpl Clone for PropOrSpread
impl Clone for PropOrSpread
sourcefn clone(&self) -> PropOrSpread
fn clone(&self) -> PropOrSpread
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for PropOrSpread
impl Debug for PropOrSpread
sourceimpl<'de> Deserialize<'de> for PropOrSpread
impl<'de> Deserialize<'de> for PropOrSpread
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>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl EqIgnoreSpan for PropOrSpread
impl EqIgnoreSpan for PropOrSpread
fn eq_ignore_span(&self, other: &Self) -> bool
sourceimpl From<Prop> for PropOrSpread
impl From<Prop> for PropOrSpread
sourcefn from(src: Prop) -> PropOrSpread
fn from(src: Prop) -> PropOrSpread
Converts to this type from the input type.
sourceimpl From<SpreadElement> for PropOrSpread
impl From<SpreadElement> for PropOrSpread
sourcefn from(v: SpreadElement) -> Self
fn from(v: SpreadElement) -> Self
Converts to this type from the input type.
sourceimpl Hash for PropOrSpread
impl Hash for PropOrSpread
sourceimpl PartialEq<PropOrSpread> for PropOrSpread
impl PartialEq<PropOrSpread> for PropOrSpread
sourcefn eq(&self, other: &PropOrSpread) -> bool
fn eq(&self, other: &PropOrSpread) -> bool
sourceimpl Serialize for PropOrSpread
impl Serialize for PropOrSpread
sourceimpl Spanned for PropOrSpread
impl Spanned for PropOrSpread
sourceimpl Take for PropOrSpread
impl Take for PropOrSpread
impl Eq for PropOrSpread
impl StructuralEq for PropOrSpread
impl StructuralPartialEq for PropOrSpread
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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more