Enum swc_ecma_ast::Expr [−][src]
pub enum Expr {
Show 35 variants
This(ThisExpr),
Array(ArrayLit),
Object(ObjectLit),
Fn(FnExpr),
Unary(UnaryExpr),
Update(UpdateExpr),
Bin(BinExpr),
Assign(AssignExpr),
Member(MemberExpr),
Cond(CondExpr),
Call(CallExpr),
New(NewExpr),
Seq(SeqExpr),
Ident(Ident),
Lit(Lit),
Tpl(Tpl),
TaggedTpl(TaggedTpl),
Arrow(ArrowExpr),
Class(ClassExpr),
Yield(YieldExpr),
MetaProp(MetaPropExpr),
Await(AwaitExpr),
Paren(ParenExpr),
JSXMember(JSXMemberExpr),
JSXNamespacedName(JSXNamespacedName),
JSXEmpty(JSXEmptyExpr),
JSXElement(Box<JSXElement>),
JSXFragment(JSXFragment),
TsTypeAssertion(TsTypeAssertion),
TsConstAssertion(TsConstAssertion),
TsNonNull(TsNonNullExpr),
TsAs(TsAsExpr),
PrivateName(PrivateName),
OptChain(OptChainExpr),
Invalid(Invalid),
}
Variants
This(ThisExpr)
Tuple Fields
0: ThisExpr
Array(ArrayLit)
Tuple Fields
0: ArrayLit
Object(ObjectLit)
Tuple Fields
0: ObjectLit
Fn(FnExpr)
Tuple Fields
0: FnExpr
Unary(UnaryExpr)
Tuple Fields
0: UnaryExpr
Update(UpdateExpr)
Tuple Fields
0: UpdateExpr
++v
, --v
, v++
, v--
Bin(BinExpr)
Tuple Fields
0: BinExpr
Assign(AssignExpr)
Tuple Fields
0: AssignExpr
Member(MemberExpr)
Tuple Fields
0: MemberExpr
A member expression. If computed is true, the node corresponds to a computed (a[b]) member expression and property is an Expression. If computed is false, the node corresponds to a static (a.b) member expression and property is an Identifier.
Cond(CondExpr)
Tuple Fields
0: CondExpr
true ? ‘a’ : ‘b’
Call(CallExpr)
Tuple Fields
0: CallExpr
New(NewExpr)
Tuple Fields
0: NewExpr
new Cat()
Seq(SeqExpr)
Tuple Fields
0: SeqExpr
Ident(Ident)
Tuple Fields
0: Ident
Lit(Lit)
Tuple Fields
0: Lit
Tpl(Tpl)
Tuple Fields
0: Tpl
TaggedTpl(TaggedTpl)
Tuple Fields
0: TaggedTpl
Arrow(ArrowExpr)
Tuple Fields
0: ArrowExpr
Class(ClassExpr)
Tuple Fields
0: ClassExpr
Yield(YieldExpr)
Tuple Fields
0: YieldExpr
MetaProp(MetaPropExpr)
Tuple Fields
0: MetaPropExpr
Await(AwaitExpr)
Tuple Fields
0: AwaitExpr
Paren(ParenExpr)
Tuple Fields
0: ParenExpr
JSXMember(JSXMemberExpr)
Tuple Fields
JSXNamespacedName(JSXNamespacedName)
Tuple Fields
JSXEmpty(JSXEmptyExpr)
Tuple Fields
0: JSXEmptyExpr
JSXElement(Box<JSXElement>)
Tuple Fields
0: Box<JSXElement>
JSXFragment(JSXFragment)
Tuple Fields
0: JSXFragment
TsTypeAssertion(TsTypeAssertion)
Tuple Fields
TsConstAssertion(TsConstAssertion)
Tuple Fields
TsNonNull(TsNonNullExpr)
Tuple Fields
TsAs(TsAsExpr)
Tuple Fields
0: TsAsExpr
PrivateName(PrivateName)
Tuple Fields
0: PrivateName
OptChain(OptChainExpr)
Tuple Fields
0: OptChainExpr
Invalid(Invalid)
Tuple Fields
0: Invalid
Implementations
Returns Some
if self
is of variant This
, and None
otherwise.
Returns Some
if self
is of variant Array
, and None
otherwise.
Returns Some
if self
is of variant Object
, and None
otherwise.
Returns true
if self
is of variant Fn
.
Returns Some
if self
is of variant Fn
, and None
otherwise.
Returns Some
if self
is of variant Unary
, and None
otherwise.
Returns Some
if self
is of variant Update
, and None
otherwise.
Returns Some
if self
is of variant Assign
, and None
otherwise.
Returns Some
if self
is of variant Member
, and None
otherwise.
Returns Some
if self
is of variant Cond
, and None
otherwise.
Returns Some
if self
is of variant Call
, and None
otherwise.
Returns Some
if self
is of variant Ident
, and None
otherwise.
Returns true
if self
is of variant TaggedTpl
.
Returns Some
if self
is of variant TaggedTpl
, and None
otherwise.
Returns Some
if self
is of variant Arrow
, and None
otherwise.
Returns Some
if self
is of variant Class
, and None
otherwise.
Returns true
if self
is of variant Yield
.
Returns Some
if self
is of variant Yield
, and None
otherwise.
Returns true
if self
is of variant MetaProp
.
Returns Some
if self
is of variant MetaProp
, and None
otherwise.
Returns true
if self
is of variant Await
.
Returns Some
if self
is of variant Await
, and None
otherwise.
Returns Some
if self
is of variant Paren
, and None
otherwise.
Returns true
if self
is of variant JSXMember
.
Returns Some
if self
is of variant JSXMember
, and None
otherwise.
Returns true
if self
is of variant JSXNamespacedName
.
Unwraps the value, yielding the content of JSXNamespacedName
.
Panics
Panics if the value is not JSXNamespacedName
, with a panic message including the content of self
.
Returns Some
if self
is of variant JSXNamespacedName
, and None
otherwise.
Returns true
if self
is of variant JSXEmpty
.
Returns Some
if self
is of variant JSXEmpty
, and None
otherwise.
Returns true
if self
is of variant JSXElement
.
Unwraps the value, yielding the content of JSXElement
.
Panics
Panics if the value is not JSXElement
, with a panic message including the content of self
.
Returns Some
if self
is of variant JSXElement
, and None
otherwise.
Returns true
if self
is of variant JSXFragment
.
Unwraps the value, yielding the content of JSXFragment
.
Panics
Panics if the value is not JSXFragment
, with a panic message including the content of self
.
Returns Some
if self
is of variant JSXFragment
, and None
otherwise.
Returns true
if self
is of variant TsTypeAssertion
.
Unwraps the value, yielding the content of TsTypeAssertion
.
Panics
Panics if the value is not TsTypeAssertion
, with a panic message including the content of self
.
Returns Some
if self
is of variant TsTypeAssertion
, and None
otherwise.
Returns true
if self
is of variant TsConstAssertion
.
Unwraps the value, yielding the content of TsConstAssertion
.
Panics
Panics if the value is not TsConstAssertion
, with a panic message including the content of self
.
Returns Some
if self
is of variant TsConstAssertion
, and None
otherwise.
Returns true
if self
is of variant TsNonNull
.
Returns Some
if self
is of variant TsNonNull
, and None
otherwise.
Returns Some
if self
is of variant TsAs
, and None
otherwise.
Returns true
if self
is of variant PrivateName
.
Unwraps the value, yielding the content of PrivateName
.
Panics
Panics if the value is not PrivateName
, with a panic message including the content of self
.
Returns Some
if self
is of variant PrivateName
, and None
otherwise.
Returns true
if self
is of variant OptChain
.
Returns Some
if self
is of variant OptChain
, and None
otherwise.
Returns true
if self
is of variant Invalid
.
Trait Implementations
Deserialize this value from the given Serde deserializer. Read more
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Auto Trait Implementations
impl RefUnwindSafe for Expr
impl UnwindSafe for Expr
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more