Enum swc_ecma_ast::Expr[][src]

pub enum Expr {
Show 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)
Array(ArrayLit)
Object(ObjectLit)
Fn(FnExpr)
Unary(UnaryExpr)
Update(UpdateExpr)

++v, --v, v++, v--

Bin(BinExpr)
Assign(AssignExpr)
Member(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)

true ? ‘a’ : ‘b’

Call(CallExpr)
New(NewExpr)

new Cat()

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)

Implementations

Returns true if self is of variant This.

Unwraps the value, yielding the content of This.

Panics

Panics if the value is not This, with a panic message including the content of self.

Returns Some if self is of variant This, and None otherwise.

Returns true if self is of variant Array.

Unwraps the value, yielding the content of Array.

Panics

Panics if the value is not Array, with a panic message including the content of self.

Returns Some if self is of variant Array, and None otherwise.

Returns true if self is of variant Object.

Unwraps the value, yielding the content of Object.

Panics

Panics if the value is not Object, with a panic message including the content of self.

Returns Some if self is of variant Object, and None otherwise.

Returns true if self is of variant Fn.

Unwraps the value, yielding the content of Fn.

Panics

Panics if the value is not Fn, with a panic message including the content of self.

Returns Some if self is of variant Fn, and None otherwise.

Returns true if self is of variant Unary.

Unwraps the value, yielding the content of Unary.

Panics

Panics if the value is not Unary, with a panic message including the content of self.

Returns Some if self is of variant Unary, and None otherwise.

Returns true if self is of variant Update.

Unwraps the value, yielding the content of Update.

Panics

Panics if the value is not Update, with a panic message including the content of self.

Returns Some if self is of variant Update, and None otherwise.

Returns true if self is of variant Bin.

Unwraps the value, yielding the content of Bin.

Panics

Panics if the value is not Bin, with a panic message including the content of self.

Returns Some if self is of variant Bin, and None otherwise.

Returns true if self is of variant Assign.

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.

Returns Some if self is of variant Assign, and None otherwise.

Returns true if self is of variant Member.

Unwraps the value, yielding the content of Member.

Panics

Panics if the value is not Member, with a panic message including the content of self.

Returns Some if self is of variant Member, and None otherwise.

Returns true if self is of variant Cond.

Unwraps the value, yielding the content of Cond.

Panics

Panics if the value is not Cond, with a panic message including the content of self.

Returns Some if self is of variant Cond, and None otherwise.

Returns true if self is of variant Call.

Unwraps the value, yielding the content of Call.

Panics

Panics if the value is not Call, with a panic message including the content of self.

Returns Some if self is of variant Call, and None otherwise.

Returns true if self is of variant New.

Unwraps the value, yielding the content of New.

Panics

Panics if the value is not New, with a panic message including the content of self.

Returns Some if self is of variant New, and None otherwise.

Returns true if self is of variant Seq.

Unwraps the value, yielding the content of Seq.

Panics

Panics if the value is not Seq, with a panic message including the content of self.

Returns Some if self is of variant Seq, and None otherwise.

Returns true if self is of variant Ident.

Unwraps the value, yielding the content of Ident.

Panics

Panics if the value is not Ident, with a panic message including the content of self.

Returns Some if self is of variant Ident, and None otherwise.

Returns true if self is of variant Lit.

Unwraps the value, yielding the content of Lit.

Panics

Panics if the value is not Lit, with a panic message including the content of self.

Returns Some if self is of variant Lit, and None otherwise.

Returns true if self is of variant Tpl.

Unwraps the value, yielding the content of Tpl.

Panics

Panics if the value is not Tpl, with a panic message including the content of self.

Returns Some if self is of variant Tpl, and None otherwise.

Returns true if self is of variant TaggedTpl.

Unwraps the value, yielding the content of TaggedTpl.

Panics

Panics if the value is not TaggedTpl, with a panic message including the content of self.

Returns Some if self is of variant TaggedTpl, and None otherwise.

Returns true if self is of variant Arrow.

Unwraps the value, yielding the content of Arrow.

Panics

Panics if the value is not Arrow, with a panic message including the content of self.

Returns Some if self is of variant Arrow, and None otherwise.

Returns true if self is of variant Class.

Unwraps the value, yielding the content of Class.

Panics

Panics if the value is not Class, with a panic message including the content of self.

Returns Some if self is of variant Class, and None otherwise.

Returns true if self is of variant Yield.

Unwraps the value, yielding the content of Yield.

Panics

Panics if the value is not Yield, with a panic message including the content of self.

Returns Some if self is of variant Yield, and None otherwise.

Returns true if self is of variant MetaProp.

Unwraps the value, yielding the content of MetaProp.

Panics

Panics if the value is not MetaProp, with a panic message including the content of self.

Returns Some if self is of variant MetaProp, and None otherwise.

Returns true if self is of variant Await.

Unwraps the value, yielding the content of Await.

Panics

Panics if the value is not Await, with a panic message including the content of self.

Returns Some if self is of variant Await, and None otherwise.

Returns true if self is of variant Paren.

Unwraps the value, yielding the content of Paren.

Panics

Panics if the value is not Paren, with a panic message including the content of self.

Returns Some if self is of variant Paren, and None otherwise.

Returns true if self is of variant JSXMember.

Unwraps the value, yielding the content of JSXMember.

Panics

Panics if the value is not JSXMember, with a panic message including the content of self.

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.

Unwraps the value, yielding the content of JSXEmpty.

Panics

Panics if the value is not JSXEmpty, with a panic message including the content of self.

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.

Unwraps the value, yielding the content of TsNonNull.

Panics

Panics if the value is not TsNonNull, with a panic message including the content of self.

Returns Some if self is of variant TsNonNull, and None otherwise.

Returns true if self is of variant TsAs.

Unwraps the value, yielding the content of TsAs.

Panics

Panics if the value is not TsAs, with a panic message including the content of self.

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.

Unwraps the value, yielding the content of OptChain.

Panics

Panics if the value is not OptChain, with a panic message including the content of self.

Returns Some if self is of variant OptChain, and None otherwise.

Returns true if self is of variant Invalid.

Unwraps the value, yielding the content of Invalid.

Panics

Panics if the value is not Invalid, with a panic message including the content of self.

Returns Some if self is of variant Invalid, and None otherwise.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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.

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.

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.

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Get span of self.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.