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

Tuple Fields of This

0: ThisExpr
Array

Tuple Fields of Array

0: ArrayLit
Object

Tuple Fields of Object

0: ObjectLit
Fn

Tuple Fields of Fn

0: FnExpr
Unary

Tuple Fields of Unary

0: UnaryExpr
Update

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

Tuple Fields of Update

0: UpdateExpr
Bin

Tuple Fields of Bin

0: BinExpr
Assign

Tuple Fields of Assign

0: AssignExpr
Member

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.

Tuple Fields of Member

0: MemberExpr
Cond

true ? ‘a’ : ‘b’

Tuple Fields of Cond

0: CondExpr
Call

Tuple Fields of Call

0: CallExpr
New

new Cat()

Tuple Fields of New

0: NewExpr
Seq

Tuple Fields of Seq

0: SeqExpr
Ident

Tuple Fields of Ident

0: Ident
Lit

Tuple Fields of Lit

0: Lit
Tpl

Tuple Fields of Tpl

0: Tpl
TaggedTpl

Tuple Fields of TaggedTpl

0: TaggedTpl
Arrow

Tuple Fields of Arrow

0: ArrowExpr
Class

Tuple Fields of Class

0: ClassExpr
Yield

Tuple Fields of Yield

0: YieldExpr
MetaProp

Tuple Fields of MetaProp

0: MetaPropExpr
Await

Tuple Fields of Await

0: AwaitExpr
Paren

Tuple Fields of Paren

0: ParenExpr
JSXMember

Tuple Fields of JSXMember

0: JSXMemberExpr
JSXNamespacedName

Tuple Fields of JSXNamespacedName

0: JSXNamespacedName
JSXEmpty

Tuple Fields of JSXEmpty

0: JSXEmptyExpr
JSXElement

Tuple Fields of JSXElement

0: Box<JSXElement>
JSXFragment

Tuple Fields of JSXFragment

0: JSXFragment
TsTypeAssertion

Tuple Fields of TsTypeAssertion

0: TsTypeAssertion
TsConstAssertion

Tuple Fields of TsConstAssertion

0: TsConstAssertion
TsNonNull

Tuple Fields of TsNonNull

0: TsNonNullExpr
TsAs

Tuple Fields of TsAs

0: TsAsExpr
PrivateName

Tuple Fields of PrivateName

0: PrivateName
OptChain

Tuple Fields of OptChain

0: OptChainExpr
Invalid

Tuple Fields of Invalid

0: 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.

Create a dummy value of this type.

Mutate self using op, which accepts owned data.

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.