Enum swc_ecma_ast::JSXObject
source · [−]pub enum JSXObject {
JSXMemberExpr(Box<JSXMemberExpr>),
Ident(Ident),
}
Expand description
Used for obj
property of JSXMemberExpr
.
Variants
JSXMemberExpr(Box<JSXMemberExpr>)
Ident(Ident)
Implementations
sourceimpl JSXObject
impl JSXObject
sourcepub fn is_jsx_member_expr(&self) -> bool
pub fn is_jsx_member_expr(&self) -> bool
Returns true
if self
is of variant JSXMemberExpr
.
sourcepub fn as_jsx_member_expr(&self) -> Option<&Box<JSXMemberExpr>>
pub fn as_jsx_member_expr(&self) -> Option<&Box<JSXMemberExpr>>
Returns Some
if self
is a reference of variant JSXMemberExpr
, and None
otherwise.
sourcepub fn as_mut_jsx_member_expr(&mut self) -> Option<&mut Box<JSXMemberExpr>>
pub fn as_mut_jsx_member_expr(&mut self) -> Option<&mut Box<JSXMemberExpr>>
Returns Some
if self
is a mutable reference of variant JSXMemberExpr
, and None
otherwise.
sourcepub fn expect_jsx_member_expr(self) -> Box<JSXMemberExpr>where
Self: Debug,
pub fn expect_jsx_member_expr(self) -> Box<JSXMemberExpr>where
Self: Debug,
Unwraps the value, yielding the content of JSXMemberExpr
.
Panics
Panics if the value is not JSXMemberExpr
, with a panic message including the content of self
.
sourcepub fn jsx_member_expr(self) -> Option<Box<JSXMemberExpr>>
pub fn jsx_member_expr(self) -> Option<Box<JSXMemberExpr>>
Returns Some
if self
is of variant JSXMemberExpr
, and None
otherwise.
sourcepub fn as_ident(&self) -> Option<&Ident>
pub fn as_ident(&self) -> Option<&Ident>
Returns Some
if self
is a reference of variant Ident
, and None
otherwise.
sourcepub fn as_mut_ident(&mut self) -> Option<&mut Ident>
pub fn as_mut_ident(&mut self) -> Option<&mut Ident>
Returns Some
if self
is a mutable reference of variant Ident
, and None
otherwise.
sourcepub fn expect_ident(self) -> Identwhere
Self: Debug,
pub fn expect_ident(self) -> Identwhere
Self: Debug,
Trait Implementations
sourceimpl<'de> Deserialize<'de> for JSXObject
impl<'de> Deserialize<'de> for JSXObject
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 JSXObject
impl EqIgnoreSpan for JSXObject
fn eq_ignore_span(&self, other: &Self) -> bool
sourceimpl From<Box<JSXMemberExpr, Global>> for JSXObject
impl From<Box<JSXMemberExpr, Global>> for JSXObject
sourcefn from(v: Box<JSXMemberExpr>) -> Self
fn from(v: Box<JSXMemberExpr>) -> Self
Converts to this type from the input type.
impl Eq for JSXObject
impl StructuralEq for JSXObject
impl StructuralPartialEq for JSXObject
Auto Trait Implementations
impl RefUnwindSafe for JSXObject
impl Send for JSXObject
impl Sync for JSXObject
impl Unpin for JSXObject
impl UnwindSafe for JSXObject
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