[−][src]Enum swc_ecma_ast::Expr
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)
TsTypeCast(TsTypeCastExpr)
TsAs(TsAsExpr)
PrivateName(PrivateName)
OptChain(OptChainExpr)
Invalid(Invalid)
Implementations
impl Expr
[src]
pub fn is_this(&self) -> bool
[src]
Returns true
if self
is of variant This
.
pub fn expect_this(self) -> ThisExpr where
Self: Debug,
[src]
Self: Debug,
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
.
pub fn this(self) -> Option<ThisExpr>
[src]
Returns Some
if self
is of variant This
, and None
otherwise.
pub fn is_array(&self) -> bool
[src]
Returns true
if self
is of variant Array
.
pub fn expect_array(self) -> ArrayLit where
Self: Debug,
[src]
Self: Debug,
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
.
pub fn array(self) -> Option<ArrayLit>
[src]
Returns Some
if self
is of variant Array
, and None
otherwise.
pub fn is_object(&self) -> bool
[src]
Returns true
if self
is of variant Object
.
pub fn expect_object(self) -> ObjectLit where
Self: Debug,
[src]
Self: Debug,
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
.
pub fn object(self) -> Option<ObjectLit>
[src]
Returns Some
if self
is of variant Object
, and None
otherwise.
pub fn is_fn_expr(&self) -> bool
[src]
Returns true
if self
is of variant Fn
.
pub fn expect_fn_expr(self) -> FnExpr where
Self: Debug,
[src]
Self: Debug,
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
.
pub fn fn_expr(self) -> Option<FnExpr>
[src]
Returns Some
if self
is of variant Fn
, and None
otherwise.
pub fn is_unary(&self) -> bool
[src]
Returns true
if self
is of variant Unary
.
pub fn expect_unary(self) -> UnaryExpr where
Self: Debug,
[src]
Self: Debug,
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
.
pub fn unary(self) -> Option<UnaryExpr>
[src]
Returns Some
if self
is of variant Unary
, and None
otherwise.
pub fn is_update(&self) -> bool
[src]
Returns true
if self
is of variant Update
.
pub fn expect_update(self) -> UpdateExpr where
Self: Debug,
[src]
Self: Debug,
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
.
pub fn update(self) -> Option<UpdateExpr>
[src]
Returns Some
if self
is of variant Update
, and None
otherwise.
pub fn is_bin(&self) -> bool
[src]
Returns true
if self
is of variant Bin
.
pub fn expect_bin(self) -> BinExpr where
Self: Debug,
[src]
Self: Debug,
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
.
pub fn bin(self) -> Option<BinExpr>
[src]
Returns Some
if self
is of variant Bin
, and None
otherwise.
pub fn is_assign(&self) -> bool
[src]
Returns true
if self
is of variant Assign
.
pub fn expect_assign(self) -> AssignExpr where
Self: Debug,
[src]
Self: Debug,
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
.
pub fn assign(self) -> Option<AssignExpr>
[src]
Returns Some
if self
is of variant Assign
, and None
otherwise.
pub fn is_member(&self) -> bool
[src]
Returns true
if self
is of variant Member
.
pub fn expect_member(self) -> MemberExpr where
Self: Debug,
[src]
Self: Debug,
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
.
pub fn member(self) -> Option<MemberExpr>
[src]
Returns Some
if self
is of variant Member
, and None
otherwise.
pub fn is_cond(&self) -> bool
[src]
Returns true
if self
is of variant Cond
.
pub fn expect_cond(self) -> CondExpr where
Self: Debug,
[src]
Self: Debug,
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
.
pub fn cond(self) -> Option<CondExpr>
[src]
Returns Some
if self
is of variant Cond
, and None
otherwise.
pub fn is_call(&self) -> bool
[src]
Returns true
if self
is of variant Call
.
pub fn expect_call(self) -> CallExpr where
Self: Debug,
[src]
Self: Debug,
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
.
pub fn call(self) -> Option<CallExpr>
[src]
Returns Some
if self
is of variant Call
, and None
otherwise.
pub fn is_new(&self) -> bool
[src]
Returns true
if self
is of variant New
.
pub fn expect_new(self) -> NewExpr where
Self: Debug,
[src]
Self: Debug,
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
.
pub fn new(self) -> Option<NewExpr>
[src]
Returns Some
if self
is of variant New
, and None
otherwise.
pub fn is_seq(&self) -> bool
[src]
Returns true
if self
is of variant Seq
.
pub fn expect_seq(self) -> SeqExpr where
Self: Debug,
[src]
Self: Debug,
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
.
pub fn seq(self) -> Option<SeqExpr>
[src]
Returns Some
if self
is of variant Seq
, and None
otherwise.
pub fn is_ident(&self) -> bool
[src]
Returns true
if self
is of variant Ident
.
pub fn expect_ident(self) -> Ident where
Self: Debug,
[src]
Self: Debug,
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
.
pub fn ident(self) -> Option<Ident>
[src]
Returns Some
if self
is of variant Ident
, and None
otherwise.
pub fn is_lit(&self) -> bool
[src]
Returns true
if self
is of variant Lit
.
pub fn expect_lit(self) -> Lit where
Self: Debug,
[src]
Self: Debug,
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
.
pub fn lit(self) -> Option<Lit>
[src]
Returns Some
if self
is of variant Lit
, and None
otherwise.
pub fn is_tpl(&self) -> bool
[src]
Returns true
if self
is of variant Tpl
.
pub fn expect_tpl(self) -> Tpl where
Self: Debug,
[src]
Self: Debug,
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
.
pub fn tpl(self) -> Option<Tpl>
[src]
Returns Some
if self
is of variant Tpl
, and None
otherwise.
pub fn is_tagged_tpl(&self) -> bool
[src]
Returns true
if self
is of variant TaggedTpl
.
pub fn expect_tagged_tpl(self) -> TaggedTpl where
Self: Debug,
[src]
Self: Debug,
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
.
pub fn tagged_tpl(self) -> Option<TaggedTpl>
[src]
Returns Some
if self
is of variant TaggedTpl
, and None
otherwise.
pub fn is_arrow(&self) -> bool
[src]
Returns true
if self
is of variant Arrow
.
pub fn expect_arrow(self) -> ArrowExpr where
Self: Debug,
[src]
Self: Debug,
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
.
pub fn arrow(self) -> Option<ArrowExpr>
[src]
Returns Some
if self
is of variant Arrow
, and None
otherwise.
pub fn is_class(&self) -> bool
[src]
Returns true
if self
is of variant Class
.
pub fn expect_class(self) -> ClassExpr where
Self: Debug,
[src]
Self: Debug,
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
.
pub fn class(self) -> Option<ClassExpr>
[src]
Returns Some
if self
is of variant Class
, and None
otherwise.
pub fn is_yield_expr(&self) -> bool
[src]
Returns true
if self
is of variant Yield
.
pub fn expect_yield_expr(self) -> YieldExpr where
Self: Debug,
[src]
Self: Debug,
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
.
pub fn yield_expr(self) -> Option<YieldExpr>
[src]
Returns Some
if self
is of variant Yield
, and None
otherwise.
pub fn is_meta_prop(&self) -> bool
[src]
Returns true
if self
is of variant MetaProp
.
pub fn expect_meta_prop(self) -> MetaPropExpr where
Self: Debug,
[src]
Self: Debug,
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
.
pub fn meta_prop(self) -> Option<MetaPropExpr>
[src]
Returns Some
if self
is of variant MetaProp
, and None
otherwise.
pub fn is_await_expr(&self) -> bool
[src]
Returns true
if self
is of variant Await
.
pub fn expect_await_expr(self) -> AwaitExpr where
Self: Debug,
[src]
Self: Debug,
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
.
pub fn await_expr(self) -> Option<AwaitExpr>
[src]
Returns Some
if self
is of variant Await
, and None
otherwise.
pub fn is_paren(&self) -> bool
[src]
Returns true
if self
is of variant Paren
.
pub fn expect_paren(self) -> ParenExpr where
Self: Debug,
[src]
Self: Debug,
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
.
pub fn paren(self) -> Option<ParenExpr>
[src]
Returns Some
if self
is of variant Paren
, and None
otherwise.
pub fn is_jsx_member(&self) -> bool
[src]
Returns true
if self
is of variant JSXMember
.
pub fn expect_jsx_member(self) -> JSXMemberExpr where
Self: Debug,
[src]
Self: Debug,
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
.
pub fn jsx_member(self) -> Option<JSXMemberExpr>
[src]
Returns Some
if self
is of variant JSXMember
, and None
otherwise.
pub fn is_jsx_namespaced_name(&self) -> bool
[src]
Returns true
if self
is of variant JSXNamespacedName
.
pub fn expect_jsx_namespaced_name(self) -> JSXNamespacedName where
Self: Debug,
[src]
Self: Debug,
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
.
pub fn jsx_namespaced_name(self) -> Option<JSXNamespacedName>
[src]
Returns Some
if self
is of variant JSXNamespacedName
, and None
otherwise.
pub fn is_jsx_empty(&self) -> bool
[src]
Returns true
if self
is of variant JSXEmpty
.
pub fn expect_jsx_empty(self) -> JSXEmptyExpr where
Self: Debug,
[src]
Self: Debug,
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
.
pub fn jsx_empty(self) -> Option<JSXEmptyExpr>
[src]
Returns Some
if self
is of variant JSXEmpty
, and None
otherwise.
pub fn is_jsx_element(&self) -> bool
[src]
Returns true
if self
is of variant JSXElement
.
pub fn expect_jsx_element(self) -> Box<JSXElement> where
Self: Debug,
[src]
Self: Debug,
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
.
pub fn jsx_element(self) -> Option<Box<JSXElement>>
[src]
Returns Some
if self
is of variant JSXElement
, and None
otherwise.
pub fn is_jsx_fragment(&self) -> bool
[src]
Returns true
if self
is of variant JSXFragment
.
pub fn expect_jsx_fragment(self) -> JSXFragment where
Self: Debug,
[src]
Self: Debug,
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
.
pub fn jsx_fragment(self) -> Option<JSXFragment>
[src]
Returns Some
if self
is of variant JSXFragment
, and None
otherwise.
pub fn is_ts_type_assertion(&self) -> bool
[src]
Returns true
if self
is of variant TsTypeAssertion
.
pub fn expect_ts_type_assertion(self) -> TsTypeAssertion where
Self: Debug,
[src]
Self: Debug,
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
.
pub fn ts_type_assertion(self) -> Option<TsTypeAssertion>
[src]
Returns Some
if self
is of variant TsTypeAssertion
, and None
otherwise.
pub fn is_ts_const_assertion(&self) -> bool
[src]
Returns true
if self
is of variant TsConstAssertion
.
pub fn expect_ts_const_assertion(self) -> TsConstAssertion where
Self: Debug,
[src]
Self: Debug,
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
.
pub fn ts_const_assertion(self) -> Option<TsConstAssertion>
[src]
Returns Some
if self
is of variant TsConstAssertion
, and None
otherwise.
pub fn is_ts_non_null(&self) -> bool
[src]
Returns true
if self
is of variant TsNonNull
.
pub fn expect_ts_non_null(self) -> TsNonNullExpr where
Self: Debug,
[src]
Self: Debug,
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
.
pub fn ts_non_null(self) -> Option<TsNonNullExpr>
[src]
Returns Some
if self
is of variant TsNonNull
, and None
otherwise.
pub fn is_ts_type_cast(&self) -> bool
[src]
Returns true
if self
is of variant TsTypeCast
.
pub fn expect_ts_type_cast(self) -> TsTypeCastExpr where
Self: Debug,
[src]
Self: Debug,
Unwraps the value, yielding the content of TsTypeCast
.
Panics
Panics if the value is not TsTypeCast
, with a panic message including the content of self
.
pub fn ts_type_cast(self) -> Option<TsTypeCastExpr>
[src]
Returns Some
if self
is of variant TsTypeCast
, and None
otherwise.
pub fn is_ts_as(&self) -> bool
[src]
Returns true
if self
is of variant TsAs
.
pub fn expect_ts_as(self) -> TsAsExpr where
Self: Debug,
[src]
Self: Debug,
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
.
pub fn ts_as(self) -> Option<TsAsExpr>
[src]
Returns Some
if self
is of variant TsAs
, and None
otherwise.
pub fn is_private_name(&self) -> bool
[src]
Returns true
if self
is of variant PrivateName
.
pub fn expect_private_name(self) -> PrivateName where
Self: Debug,
[src]
Self: Debug,
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
.
pub fn private_name(self) -> Option<PrivateName>
[src]
Returns Some
if self
is of variant PrivateName
, and None
otherwise.
pub fn is_opt_chain(&self) -> bool
[src]
Returns true
if self
is of variant OptChain
.
pub fn expect_opt_chain(self) -> OptChainExpr where
Self: Debug,
[src]
Self: Debug,
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
.
pub fn opt_chain(self) -> Option<OptChainExpr>
[src]
Returns Some
if self
is of variant OptChain
, and None
otherwise.
pub fn is_invalid(&self) -> bool
[src]
Returns true
if self
is of variant Invalid
.
pub fn expect_invalid(self) -> Invalid where
Self: Debug,
[src]
Self: Debug,
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
.
pub fn invalid(self) -> Option<Invalid>
[src]
Returns Some
if self
is of variant Invalid
, and None
otherwise.
Trait Implementations
impl Clone for Expr
[src]
impl Debug for Expr
[src]
impl<'de> Deserialize<'de> for Expr
[src]
fn deserialize<D>(Deserializer: D) -> Result<Self, D::Error> where
D: Deserializer<'de>,
[src]
D: Deserializer<'de>,
impl Eq for Expr
[src]
impl From<ArrayLit> for Expr
[src]
impl From<ArrowExpr> for Expr
[src]
impl From<AssignExpr> for Expr
[src]
fn from(v: AssignExpr) -> Self
[src]
impl From<AwaitExpr> for Expr
[src]
impl From<BinExpr> for Expr
[src]
impl From<Bool> for Expr
[src]
impl From<Box<JSXElement>> for Expr
[src]
fn from(v: Box<JSXElement>) -> Self
[src]
impl From<CallExpr> for Expr
[src]
impl From<ClassExpr> for Expr
[src]
impl From<CondExpr> for Expr
[src]
impl From<FnExpr> for Expr
[src]
impl From<Ident> for Expr
[src]
impl From<Invalid> for Expr
[src]
impl From<JSXEmptyExpr> for Expr
[src]
fn from(v: JSXEmptyExpr) -> Self
[src]
impl From<JSXFragment> for Expr
[src]
fn from(v: JSXFragment) -> Self
[src]
impl From<JSXMemberExpr> for Expr
[src]
fn from(v: JSXMemberExpr) -> Self
[src]
impl From<JSXNamespacedName> for Expr
[src]
fn from(v: JSXNamespacedName) -> Self
[src]
impl From<Lit> for Expr
[src]
impl From<MemberExpr> for Expr
[src]
fn from(v: MemberExpr) -> Self
[src]
impl From<MetaPropExpr> for Expr
[src]
fn from(v: MetaPropExpr) -> Self
[src]
impl From<NewExpr> for Expr
[src]
impl From<Number> for Expr
[src]
impl From<ObjectLit> for Expr
[src]
impl From<OptChainExpr> for Expr
[src]
fn from(v: OptChainExpr) -> Self
[src]
impl From<ParenExpr> for Expr
[src]
impl From<PrivateName> for Expr
[src]
fn from(v: PrivateName) -> Self
[src]
impl From<SeqExpr> for Expr
[src]
impl From<Str> for Expr
[src]
impl From<TaggedTpl> for Expr
[src]
impl From<ThisExpr> for Expr
[src]
impl From<Tpl> for Expr
[src]
impl From<TsAsExpr> for Expr
[src]
impl From<TsConstAssertion> for Expr
[src]
fn from(v: TsConstAssertion) -> Self
[src]
impl From<TsNonNullExpr> for Expr
[src]
fn from(v: TsNonNullExpr) -> Self
[src]
impl From<TsTypeAssertion> for Expr
[src]
fn from(v: TsTypeAssertion) -> Self
[src]
impl From<TsTypeCastExpr> for Expr
[src]
fn from(v: TsTypeCastExpr) -> Self
[src]
impl From<UnaryExpr> for Expr
[src]
impl From<UpdateExpr> for Expr
[src]
fn from(v: UpdateExpr) -> Self
[src]
impl From<YieldExpr> for Expr
[src]
impl From<bool> for Expr
[src]
impl From<f64> for Expr
[src]
impl Hash for Expr
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<Expr> for Expr
[src]
impl Serialize for Expr
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl Spanned for Expr
[src]
impl StructuralEq for Expr
[src]
impl StructuralPartialEq for Expr
[src]
Auto Trait Implementations
impl RefUnwindSafe for Expr
impl Send for Expr
impl Sync for Expr
impl Unpin for Expr
impl UnwindSafe for Expr
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Send for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Sync for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,