swc_ecma_ast

Enum Expr

source
pub enum Expr {
Show 38 variants This(ThisExpr), Array(ArrayLit), Object(ObjectLit), Fn(FnExpr), Unary(UnaryExpr), Update(UpdateExpr), Bin(BinExpr), Assign(AssignExpr), Member(MemberExpr), SuperProp(SuperPropExpr), 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), TsInstantiation(TsInstantiation), TsSatisfies(TsSatisfiesExpr), 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.

§

SuperProp(SuperPropExpr)

§

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)

§

TsInstantiation(TsInstantiation)

§

TsSatisfies(TsSatisfiesExpr)

§

PrivateName(PrivateName)

§

OptChain(OptChainExpr)

§

Invalid(Invalid)

Implementations§

source§

impl Expr

source

pub const fn is_this(&self) -> bool

Returns true if self is of variant This.

source

pub fn as_this(&self) -> Option<&ThisExpr>

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

source

pub fn as_mut_this(&mut self) -> Option<&mut ThisExpr>

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

source

pub fn expect_this(self) -> ThisExpr
where 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.

source

pub fn this(self) -> Option<ThisExpr>

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

source

pub const fn is_array(&self) -> bool

Returns true if self is of variant Array.

source

pub fn as_array(&self) -> Option<&ArrayLit>

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

source

pub fn as_mut_array(&mut self) -> Option<&mut ArrayLit>

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

source

pub fn expect_array(self) -> ArrayLit
where 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.

source

pub fn array(self) -> Option<ArrayLit>

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

source

pub const fn is_object(&self) -> bool

Returns true if self is of variant Object.

source

pub fn as_object(&self) -> Option<&ObjectLit>

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

source

pub fn as_mut_object(&mut self) -> Option<&mut ObjectLit>

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

source

pub fn expect_object(self) -> ObjectLit
where 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.

source

pub fn object(self) -> Option<ObjectLit>

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

source

pub const fn is_fn_expr(&self) -> bool

Returns true if self is of variant Fn.

source

pub fn as_fn_expr(&self) -> Option<&FnExpr>

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

source

pub fn as_mut_fn_expr(&mut self) -> Option<&mut FnExpr>

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

source

pub fn expect_fn_expr(self) -> FnExpr
where 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.

source

pub fn fn_expr(self) -> Option<FnExpr>

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

source

pub const fn is_unary(&self) -> bool

Returns true if self is of variant Unary.

source

pub fn as_unary(&self) -> Option<&UnaryExpr>

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

source

pub fn as_mut_unary(&mut self) -> Option<&mut UnaryExpr>

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

source

pub fn expect_unary(self) -> UnaryExpr
where 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.

source

pub fn unary(self) -> Option<UnaryExpr>

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

source

pub const fn is_update(&self) -> bool

Returns true if self is of variant Update.

source

pub fn as_update(&self) -> Option<&UpdateExpr>

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

source

pub fn as_mut_update(&mut self) -> Option<&mut UpdateExpr>

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

source

pub fn expect_update(self) -> UpdateExpr
where 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.

source

pub fn update(self) -> Option<UpdateExpr>

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

source

pub const fn is_bin(&self) -> bool

Returns true if self is of variant Bin.

source

pub fn as_bin(&self) -> Option<&BinExpr>

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

source

pub fn as_mut_bin(&mut self) -> Option<&mut BinExpr>

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

source

pub fn expect_bin(self) -> BinExpr
where 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.

source

pub fn bin(self) -> Option<BinExpr>

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

source

pub const fn is_assign(&self) -> bool

Returns true if self is of variant Assign.

source

pub fn as_assign(&self) -> Option<&AssignExpr>

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

source

pub fn as_mut_assign(&mut self) -> Option<&mut AssignExpr>

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

source

pub fn expect_assign(self) -> AssignExpr
where 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.

source

pub fn assign(self) -> Option<AssignExpr>

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

source

pub const fn is_member(&self) -> bool

Returns true if self is of variant Member.

source

pub fn as_member(&self) -> Option<&MemberExpr>

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

source

pub fn as_mut_member(&mut self) -> Option<&mut MemberExpr>

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

source

pub fn expect_member(self) -> MemberExpr
where 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.

source

pub fn member(self) -> Option<MemberExpr>

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

source

pub const fn is_super_prop(&self) -> bool

Returns true if self is of variant SuperProp.

source

pub fn as_super_prop(&self) -> Option<&SuperPropExpr>

Returns Some if self is a reference of variant SuperProp, and None otherwise.

source

pub fn as_mut_super_prop(&mut self) -> Option<&mut SuperPropExpr>

Returns Some if self is a mutable reference of variant SuperProp, and None otherwise.

source

pub fn expect_super_prop(self) -> SuperPropExpr
where Self: Debug,

Unwraps the value, yielding the content of SuperProp.

§Panics

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

source

pub fn super_prop(self) -> Option<SuperPropExpr>

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

source

pub const fn is_cond(&self) -> bool

Returns true if self is of variant Cond.

source

pub fn as_cond(&self) -> Option<&CondExpr>

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

source

pub fn as_mut_cond(&mut self) -> Option<&mut CondExpr>

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

source

pub fn expect_cond(self) -> CondExpr
where 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.

source

pub fn cond(self) -> Option<CondExpr>

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

source

pub const fn is_call(&self) -> bool

Returns true if self is of variant Call.

source

pub fn as_call(&self) -> Option<&CallExpr>

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

source

pub fn as_mut_call(&mut self) -> Option<&mut CallExpr>

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

source

pub fn expect_call(self) -> CallExpr
where 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.

source

pub fn call(self) -> Option<CallExpr>

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

source

pub const fn is_new(&self) -> bool

Returns true if self is of variant New.

source

pub fn as_new(&self) -> Option<&NewExpr>

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

source

pub fn as_mut_new(&mut self) -> Option<&mut NewExpr>

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

source

pub fn expect_new(self) -> NewExpr
where 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.

source

pub fn new(self) -> Option<NewExpr>

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

source

pub const fn is_seq(&self) -> bool

Returns true if self is of variant Seq.

source

pub fn as_seq(&self) -> Option<&SeqExpr>

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

source

pub fn as_mut_seq(&mut self) -> Option<&mut SeqExpr>

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

source

pub fn expect_seq(self) -> SeqExpr
where 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.

source

pub fn seq(self) -> Option<SeqExpr>

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

source

pub const fn is_ident(&self) -> bool

Returns true if self is of variant Ident.

source

pub fn as_ident(&self) -> Option<&Ident>

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

source

pub fn as_mut_ident(&mut self) -> Option<&mut Ident>

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

source

pub fn expect_ident(self) -> Ident
where 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.

source

pub fn ident(self) -> Option<Ident>

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

source

pub const fn is_lit(&self) -> bool

Returns true if self is of variant Lit.

source

pub fn as_lit(&self) -> Option<&Lit>

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

source

pub fn as_mut_lit(&mut self) -> Option<&mut Lit>

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

source

pub fn expect_lit(self) -> Lit
where 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.

source

pub fn lit(self) -> Option<Lit>

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

source

pub const fn is_tpl(&self) -> bool

Returns true if self is of variant Tpl.

source

pub fn as_tpl(&self) -> Option<&Tpl>

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

source

pub fn as_mut_tpl(&mut self) -> Option<&mut Tpl>

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

source

pub fn expect_tpl(self) -> Tpl
where 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.

source

pub fn tpl(self) -> Option<Tpl>

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

source

pub const fn is_tagged_tpl(&self) -> bool

Returns true if self is of variant TaggedTpl.

source

pub fn as_tagged_tpl(&self) -> Option<&TaggedTpl>

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

source

pub fn as_mut_tagged_tpl(&mut self) -> Option<&mut TaggedTpl>

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

source

pub fn expect_tagged_tpl(self) -> TaggedTpl
where 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.

source

pub fn tagged_tpl(self) -> Option<TaggedTpl>

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

source

pub const fn is_arrow(&self) -> bool

Returns true if self is of variant Arrow.

source

pub fn as_arrow(&self) -> Option<&ArrowExpr>

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

source

pub fn as_mut_arrow(&mut self) -> Option<&mut ArrowExpr>

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

source

pub fn expect_arrow(self) -> ArrowExpr
where 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.

source

pub fn arrow(self) -> Option<ArrowExpr>

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

source

pub const fn is_class(&self) -> bool

Returns true if self is of variant Class.

source

pub fn as_class(&self) -> Option<&ClassExpr>

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

source

pub fn as_mut_class(&mut self) -> Option<&mut ClassExpr>

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

source

pub fn expect_class(self) -> ClassExpr
where 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.

source

pub fn class(self) -> Option<ClassExpr>

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

source

pub const fn is_yield_expr(&self) -> bool

Returns true if self is of variant Yield.

source

pub fn as_yield_expr(&self) -> Option<&YieldExpr>

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

source

pub fn as_mut_yield_expr(&mut self) -> Option<&mut YieldExpr>

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

source

pub fn expect_yield_expr(self) -> YieldExpr
where 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.

source

pub fn yield_expr(self) -> Option<YieldExpr>

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

source

pub const fn is_meta_prop(&self) -> bool

Returns true if self is of variant MetaProp.

source

pub fn as_meta_prop(&self) -> Option<&MetaPropExpr>

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

source

pub fn as_mut_meta_prop(&mut self) -> Option<&mut MetaPropExpr>

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

source

pub fn expect_meta_prop(self) -> MetaPropExpr
where 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.

source

pub fn meta_prop(self) -> Option<MetaPropExpr>

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

source

pub const fn is_await_expr(&self) -> bool

Returns true if self is of variant Await.

source

pub fn as_await_expr(&self) -> Option<&AwaitExpr>

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

source

pub fn as_mut_await_expr(&mut self) -> Option<&mut AwaitExpr>

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

source

pub fn expect_await_expr(self) -> AwaitExpr
where 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.

source

pub fn await_expr(self) -> Option<AwaitExpr>

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

source

pub const fn is_paren(&self) -> bool

Returns true if self is of variant Paren.

source

pub fn as_paren(&self) -> Option<&ParenExpr>

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

source

pub fn as_mut_paren(&mut self) -> Option<&mut ParenExpr>

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

source

pub fn expect_paren(self) -> ParenExpr
where 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.

source

pub fn paren(self) -> Option<ParenExpr>

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

source

pub const fn is_jsx_member(&self) -> bool

Returns true if self is of variant JSXMember.

source

pub fn as_jsx_member(&self) -> Option<&JSXMemberExpr>

Returns Some if self is a reference of variant JSXMember, and None otherwise.

source

pub fn as_mut_jsx_member(&mut self) -> Option<&mut JSXMemberExpr>

Returns Some if self is a mutable reference of variant JSXMember, and None otherwise.

source

pub fn expect_jsx_member(self) -> JSXMemberExpr
where 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.

source

pub fn jsx_member(self) -> Option<JSXMemberExpr>

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

source

pub const fn is_jsx_namespaced_name(&self) -> bool

Returns true if self is of variant JSXNamespacedName.

source

pub fn as_jsx_namespaced_name(&self) -> Option<&JSXNamespacedName>

Returns Some if self is a reference of variant JSXNamespacedName, and None otherwise.

source

pub fn as_mut_jsx_namespaced_name(&mut self) -> Option<&mut JSXNamespacedName>

Returns Some if self is a mutable reference of variant JSXNamespacedName, and None otherwise.

source

pub fn expect_jsx_namespaced_name(self) -> JSXNamespacedName
where 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.

source

pub fn jsx_namespaced_name(self) -> Option<JSXNamespacedName>

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

source

pub const fn is_jsx_empty(&self) -> bool

Returns true if self is of variant JSXEmpty.

source

pub fn as_jsx_empty(&self) -> Option<&JSXEmptyExpr>

Returns Some if self is a reference of variant JSXEmpty, and None otherwise.

source

pub fn as_mut_jsx_empty(&mut self) -> Option<&mut JSXEmptyExpr>

Returns Some if self is a mutable reference of variant JSXEmpty, and None otherwise.

source

pub fn expect_jsx_empty(self) -> JSXEmptyExpr
where 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.

source

pub fn jsx_empty(self) -> Option<JSXEmptyExpr>

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

source

pub const fn is_jsx_element(&self) -> bool

Returns true if self is of variant JSXElement.

source

pub fn as_jsx_element(&self) -> Option<&Box<JSXElement>>

Returns Some if self is a reference of variant JSXElement, and None otherwise.

source

pub fn as_mut_jsx_element(&mut self) -> Option<&mut Box<JSXElement>>

Returns Some if self is a mutable reference of variant JSXElement, and None otherwise.

source

pub fn expect_jsx_element(self) -> Box<JSXElement>
where 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.

source

pub fn jsx_element(self) -> Option<Box<JSXElement>>

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

source

pub const fn is_jsx_fragment(&self) -> bool

Returns true if self is of variant JSXFragment.

source

pub fn as_jsx_fragment(&self) -> Option<&JSXFragment>

Returns Some if self is a reference of variant JSXFragment, and None otherwise.

source

pub fn as_mut_jsx_fragment(&mut self) -> Option<&mut JSXFragment>

Returns Some if self is a mutable reference of variant JSXFragment, and None otherwise.

source

pub fn expect_jsx_fragment(self) -> JSXFragment
where 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.

source

pub fn jsx_fragment(self) -> Option<JSXFragment>

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

source

pub const fn is_ts_type_assertion(&self) -> bool

Returns true if self is of variant TsTypeAssertion.

source

pub fn as_ts_type_assertion(&self) -> Option<&TsTypeAssertion>

Returns Some if self is a reference of variant TsTypeAssertion, and None otherwise.

source

pub fn as_mut_ts_type_assertion(&mut self) -> Option<&mut TsTypeAssertion>

Returns Some if self is a mutable reference of variant TsTypeAssertion, and None otherwise.

source

pub fn expect_ts_type_assertion(self) -> TsTypeAssertion
where 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.

source

pub fn ts_type_assertion(self) -> Option<TsTypeAssertion>

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

source

pub const fn is_ts_const_assertion(&self) -> bool

Returns true if self is of variant TsConstAssertion.

source

pub fn as_ts_const_assertion(&self) -> Option<&TsConstAssertion>

Returns Some if self is a reference of variant TsConstAssertion, and None otherwise.

source

pub fn as_mut_ts_const_assertion(&mut self) -> Option<&mut TsConstAssertion>

Returns Some if self is a mutable reference of variant TsConstAssertion, and None otherwise.

source

pub fn expect_ts_const_assertion(self) -> TsConstAssertion
where 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.

source

pub fn ts_const_assertion(self) -> Option<TsConstAssertion>

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

source

pub const fn is_ts_non_null(&self) -> bool

Returns true if self is of variant TsNonNull.

source

pub fn as_ts_non_null(&self) -> Option<&TsNonNullExpr>

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

source

pub fn as_mut_ts_non_null(&mut self) -> Option<&mut TsNonNullExpr>

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

source

pub fn expect_ts_non_null(self) -> TsNonNullExpr
where 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.

source

pub fn ts_non_null(self) -> Option<TsNonNullExpr>

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

source

pub const fn is_ts_as(&self) -> bool

Returns true if self is of variant TsAs.

source

pub fn as_ts_as(&self) -> Option<&TsAsExpr>

Returns Some if self is a reference of variant TsAs, and None otherwise.

source

pub fn as_mut_ts_as(&mut self) -> Option<&mut TsAsExpr>

Returns Some if self is a mutable reference of variant TsAs, and None otherwise.

source

pub fn expect_ts_as(self) -> TsAsExpr
where 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.

source

pub fn ts_as(self) -> Option<TsAsExpr>

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

source

pub const fn is_ts_instantiation(&self) -> bool

Returns true if self is of variant TsInstantiation.

source

pub fn as_ts_instantiation(&self) -> Option<&TsInstantiation>

Returns Some if self is a reference of variant TsInstantiation, and None otherwise.

source

pub fn as_mut_ts_instantiation(&mut self) -> Option<&mut TsInstantiation>

Returns Some if self is a mutable reference of variant TsInstantiation, and None otherwise.

source

pub fn expect_ts_instantiation(self) -> TsInstantiation
where Self: Debug,

Unwraps the value, yielding the content of TsInstantiation.

§Panics

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

source

pub fn ts_instantiation(self) -> Option<TsInstantiation>

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

source

pub const fn is_ts_satisfies(&self) -> bool

Returns true if self is of variant TsSatisfies.

source

pub fn as_ts_satisfies(&self) -> Option<&TsSatisfiesExpr>

Returns Some if self is a reference of variant TsSatisfies, and None otherwise.

source

pub fn as_mut_ts_satisfies(&mut self) -> Option<&mut TsSatisfiesExpr>

Returns Some if self is a mutable reference of variant TsSatisfies, and None otherwise.

source

pub fn expect_ts_satisfies(self) -> TsSatisfiesExpr
where Self: Debug,

Unwraps the value, yielding the content of TsSatisfies.

§Panics

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

source

pub fn ts_satisfies(self) -> Option<TsSatisfiesExpr>

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

source

pub const fn is_private_name(&self) -> bool

Returns true if self is of variant PrivateName.

source

pub fn as_private_name(&self) -> Option<&PrivateName>

Returns Some if self is a reference of variant PrivateName, and None otherwise.

source

pub fn as_mut_private_name(&mut self) -> Option<&mut PrivateName>

Returns Some if self is a mutable reference of variant PrivateName, and None otherwise.

source

pub fn expect_private_name(self) -> PrivateName
where 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.

source

pub fn private_name(self) -> Option<PrivateName>

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

source

pub const fn is_opt_chain(&self) -> bool

Returns true if self is of variant OptChain.

source

pub fn as_opt_chain(&self) -> Option<&OptChainExpr>

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

source

pub fn as_mut_opt_chain(&mut self) -> Option<&mut OptChainExpr>

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

source

pub fn expect_opt_chain(self) -> OptChainExpr
where 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.

source

pub fn opt_chain(self) -> Option<OptChainExpr>

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

source

pub const fn is_invalid(&self) -> bool

Returns true if self is of variant Invalid.

source

pub fn as_invalid(&self) -> Option<&Invalid>

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

source

pub fn as_mut_invalid(&mut self) -> Option<&mut Invalid>

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

source

pub fn expect_invalid(self) -> Invalid
where 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.

source

pub fn invalid(self) -> Option<Invalid>

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

source§

impl Expr

source

pub fn undefined(span: Span) -> Box<Expr>

Creates void 0.

source

pub fn leftmost(&self) -> Option<&Ident>

source

pub fn is_ident_ref_to(&self, ident: &str) -> bool

source

pub fn unwrap_with<'a, F>(&'a self, op: F) -> &'a Expr
where F: FnMut(&'a Expr) -> Option<&'a Expr>,

Unwraps an expression with a given function.

If the provided function returns Some, the function is called again with the returned value. If the provided functions returns None, the last expression is returned.

source

pub fn unwrap_mut_with<'a, F>(&'a mut self, op: F) -> &'a mut Expr
where F: FnMut(&'a mut Expr) -> Option<&'a mut Expr>,

Unwraps an expression with a given function.

If the provided function returns Some, the function is called again with the returned value. If the provided functions returns None, the last expression is returned.

source

pub fn unwrap_parens(&self) -> &Expr

Normalize parenthesized expressions.

This will normalize (foo), ((foo)), … to foo.

If self is not a parenthesized expression, it will be returned as is.

source

pub fn unwrap_parens_mut(&mut self) -> &mut Expr

Normalize parenthesized expressions.

This will normalize (foo), ((foo)), … to foo.

If self is not a parenthesized expression, it will be returned as is.

source

pub fn unwrap_seqs_and_parens(&self) -> &Self

Normalize sequences and parenthesized expressions.

This returns the last expression of a sequence expression or the expression of a parenthesized expression.

source

pub fn from_exprs(exprs: Vec<Box<Expr>>) -> Box<Expr>

Creates an expression from exprs. This will return first element if the length is 1 and a sequential expression otherwise.

§Panics

Panics if exprs is empty.

source

pub fn directness_maters(&self) -> bool

Returns true for eval and member expressions.

source

pub fn with_span(self, span: Span) -> Expr

source

pub fn set_span(&mut self, span: Span)

Trait Implementations§

source§

impl Archive for Expr

source§

type Archived = ArchivedExpr

The archived representation of this type. Read more
source§

type Resolver = ExprResolver

The resolver for this type. It must contain all the additional information from serializing needed to make the archived type from the normal type.
source§

unsafe fn resolve( &self, pos: usize, resolver: <Self as Archive>::Resolver, out: *mut <Self as Archive>::Archived, )

Creates the archived version of this value at the given position and writes it to the given output. Read more
source§

impl Clone for Expr

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Expr

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Expr

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<'de> Deserialize<'de> for Expr

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<__D: Fallible + ?Sized> Deserialize<Expr, __D> for Archived<Expr>

source§

fn deserialize(&self, deserializer: &mut __D) -> Result<Expr, __D::Error>

Deserializes using the given deserializer
source§

impl EqIgnoreSpan for Expr

source§

fn eq_ignore_span(&self, other: &Self) -> bool

source§

impl From<&str> for Box<Expr>

source§

fn from(src: &str) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<&str> for Expr

source§

fn from(src: &str) -> Expr

Converts to this type from the input type.
source§

impl From<(Atom, SyntaxContext)> for Box<Expr>

source§

fn from(src: Id) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<(Atom, SyntaxContext)> for Expr

source§

fn from(src: Id) -> Expr

Converts to this type from the input type.
source§

impl From<ArrayLit> for Box<Expr>

source§

fn from(src: ArrayLit) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<ArrayLit> for Expr

source§

fn from(v: ArrayLit) -> Self

Converts to this type from the input type.
source§

impl From<ArrowExpr> for Box<Expr>

source§

fn from(src: ArrowExpr) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<ArrowExpr> for Expr

source§

fn from(v: ArrowExpr) -> Self

Converts to this type from the input type.
source§

impl From<AssignExpr> for Box<Expr>

source§

fn from(src: AssignExpr) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<AssignExpr> for Expr

source§

fn from(v: AssignExpr) -> Self

Converts to this type from the input type.
source§

impl From<Atom> for Box<Expr>

source§

fn from(src: Atom) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<Atom> for Expr

source§

fn from(src: Atom) -> Expr

Converts to this type from the input type.
source§

impl From<AwaitExpr> for Box<Expr>

source§

fn from(src: AwaitExpr) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<AwaitExpr> for Expr

source§

fn from(v: AwaitExpr) -> Self

Converts to this type from the input type.
source§

impl From<BigInt> for Box<Expr>

source§

fn from(src: BigInt) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<BigInt> for Box<Expr>

source§

fn from(src: BigIntValue) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<BigInt> for Expr

source§

fn from(src: BigInt) -> Expr

Converts to this type from the input type.
source§

impl From<BigInt> for Expr

source§

fn from(src: BigIntValue) -> Expr

Converts to this type from the input type.
source§

impl From<BinExpr> for Box<Expr>

source§

fn from(src: BinExpr) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<BinExpr> for Expr

source§

fn from(v: BinExpr) -> Self

Converts to this type from the input type.
source§

impl From<BindingIdent> for Box<Expr>

source§

fn from(bi: BindingIdent) -> Self

Converts to this type from the input type.
source§

impl From<Bool> for Box<Expr>

source§

fn from(src: Bool) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<Bool> for Expr

source§

fn from(src: Bool) -> Expr

Converts to this type from the input type.
source§

impl From<Box<Class>> for Box<Expr>

source§

fn from(src: Box<Class>) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<Box<Class>> for Expr

source§

fn from(src: Box<Class>) -> Expr

Converts to this type from the input type.
source§

impl From<Box<Function>> for Box<Expr>

source§

fn from(src: Box<Function>) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<Box<Function>> for Expr

source§

fn from(src: Box<Function>) -> Expr

Converts to this type from the input type.
source§

impl From<Box<JSXElement>> for Box<Expr>

source§

fn from(src: Box<JSXElement>) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<Box<JSXElement>> for Expr

source§

fn from(v: Box<JSXElement>) -> Self

Converts to this type from the input type.
source§

impl From<CallExpr> for Box<Expr>

source§

fn from(src: CallExpr) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<CallExpr> for Expr

source§

fn from(v: CallExpr) -> Self

Converts to this type from the input type.
source§

impl From<Class> for Box<Expr>

source§

fn from(src: Class) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<Class> for Expr

source§

fn from(src: Class) -> Expr

Converts to this type from the input type.
source§

impl From<ClassExpr> for Box<Expr>

source§

fn from(src: ClassExpr) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<ClassExpr> for Expr

source§

fn from(v: ClassExpr) -> Self

Converts to this type from the input type.
source§

impl From<CondExpr> for Box<Expr>

source§

fn from(src: CondExpr) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<CondExpr> for Expr

source§

fn from(v: CondExpr) -> Self

Converts to this type from the input type.
source§

impl From<Cow<'_, str>> for Box<Expr>

source§

fn from(src: Cow<'_, str>) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<Cow<'_, str>> for Expr

source§

fn from(src: Cow<'_, str>) -> Expr

Converts to this type from the input type.
source§

impl From<Expr> for ExprOrSpread

source§

fn from(src: Expr) -> ExprOrSpread

Converts to this type from the input type.
source§

impl From<Expr> for VarDeclOrExpr

source§

fn from(src: Expr) -> VarDeclOrExpr

Converts to this type from the input type.
source§

impl From<FnExpr> for Box<Expr>

source§

fn from(src: FnExpr) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<FnExpr> for Expr

source§

fn from(v: FnExpr) -> Self

Converts to this type from the input type.
source§

impl From<Function> for Box<Expr>

source§

fn from(src: Function) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<Function> for Expr

source§

fn from(src: Function) -> Expr

Converts to this type from the input type.
source§

impl From<Ident> for Box<Expr>

source§

fn from(src: Ident) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<Ident> for Expr

source§

fn from(v: Ident) -> Self

Converts to this type from the input type.
source§

impl From<IdentName> for Box<Expr>

source§

fn from(src: IdentName) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<IdentName> for Expr

source§

fn from(src: IdentName) -> Expr

Converts to this type from the input type.
source§

impl From<Invalid> for Box<Expr>

source§

fn from(src: Invalid) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<Invalid> for Expr

source§

fn from(v: Invalid) -> Self

Converts to this type from the input type.
source§

impl From<JSXElement> for Box<Expr>

source§

fn from(src: JSXElement) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<JSXEmptyExpr> for Box<Expr>

source§

fn from(src: JSXEmptyExpr) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<JSXEmptyExpr> for Expr

source§

fn from(v: JSXEmptyExpr) -> Self

Converts to this type from the input type.
source§

impl From<JSXFragment> for Box<Expr>

source§

fn from(src: JSXFragment) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<JSXFragment> for Expr

source§

fn from(v: JSXFragment) -> Self

Converts to this type from the input type.
source§

impl From<JSXMemberExpr> for Box<Expr>

source§

fn from(src: JSXMemberExpr) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<JSXMemberExpr> for Expr

source§

fn from(v: JSXMemberExpr) -> Self

Converts to this type from the input type.
source§

impl From<JSXNamespacedName> for Box<Expr>

source§

fn from(src: JSXNamespacedName) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<JSXNamespacedName> for Expr

source§

fn from(v: JSXNamespacedName) -> Self

Converts to this type from the input type.
source§

impl From<JSXText> for Box<Expr>

source§

fn from(src: JSXText) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<JSXText> for Expr

source§

fn from(src: JSXText) -> Expr

Converts to this type from the input type.
source§

impl From<Lit> for Box<Expr>

source§

fn from(src: Lit) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<Lit> for Expr

source§

fn from(v: Lit) -> Self

Converts to this type from the input type.
source§

impl From<MemberExpr> for Box<Expr>

source§

fn from(src: MemberExpr) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<MemberExpr> for Expr

source§

fn from(v: MemberExpr) -> Self

Converts to this type from the input type.
source§

impl From<MetaPropExpr> for Box<Expr>

source§

fn from(src: MetaPropExpr) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<MetaPropExpr> for Expr

source§

fn from(v: MetaPropExpr) -> Self

Converts to this type from the input type.
source§

impl From<NewExpr> for Box<Expr>

source§

fn from(src: NewExpr) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<NewExpr> for Expr

source§

fn from(v: NewExpr) -> Self

Converts to this type from the input type.
source§

impl From<Null> for Box<Expr>

source§

fn from(src: Null) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<Null> for Expr

source§

fn from(src: Null) -> Expr

Converts to this type from the input type.
source§

impl From<Number> for Box<Expr>

source§

fn from(src: Number) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<Number> for Expr

source§

fn from(src: Number) -> Expr

Converts to this type from the input type.
source§

impl From<ObjectLit> for Box<Expr>

source§

fn from(src: ObjectLit) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<ObjectLit> for Expr

source§

fn from(v: ObjectLit) -> Self

Converts to this type from the input type.
source§

impl From<OptCall> for Box<Expr>

source§

fn from(src: OptCall) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<OptCall> for Expr

source§

fn from(src: OptCall) -> Expr

Converts to this type from the input type.
source§

impl From<OptChainBase> for Expr

source§

fn from(opt: OptChainBase) -> Self

Converts to this type from the input type.
source§

impl From<OptChainExpr> for Box<Expr>

source§

fn from(src: OptChainExpr) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<OptChainExpr> for Expr

source§

fn from(v: OptChainExpr) -> Self

Converts to this type from the input type.
source§

impl From<ParenExpr> for Box<Expr>

source§

fn from(src: ParenExpr) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<ParenExpr> for Expr

source§

fn from(v: ParenExpr) -> Self

Converts to this type from the input type.
source§

impl From<PrivateName> for Box<Expr>

source§

fn from(src: PrivateName) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<PrivateName> for Expr

source§

fn from(v: PrivateName) -> Self

Converts to this type from the input type.
source§

impl From<Regex> for Box<Expr>

source§

fn from(src: Regex) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<Regex> for Expr

source§

fn from(src: Regex) -> Expr

Converts to this type from the input type.
source§

impl From<SeqExpr> for Box<Expr>

source§

fn from(src: SeqExpr) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<SeqExpr> for Expr

source§

fn from(v: SeqExpr) -> Self

Converts to this type from the input type.
source§

impl From<SimpleAssignTarget> for Box<Expr>

source§

fn from(s: SimpleAssignTarget) -> Self

Converts to this type from the input type.
source§

impl From<Str> for Box<Expr>

source§

fn from(src: Str) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<Str> for Expr

source§

fn from(src: Str) -> Expr

Converts to this type from the input type.
source§

impl From<String> for Box<Expr>

source§

fn from(src: String) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<String> for Expr

source§

fn from(src: String) -> Expr

Converts to this type from the input type.
source§

impl From<SuperPropExpr> for Box<Expr>

source§

fn from(src: SuperPropExpr) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<SuperPropExpr> for Expr

source§

fn from(v: SuperPropExpr) -> Self

Converts to this type from the input type.
source§

impl From<TaggedTpl> for Box<Expr>

source§

fn from(src: TaggedTpl) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<TaggedTpl> for Expr

source§

fn from(v: TaggedTpl) -> Self

Converts to this type from the input type.
source§

impl From<ThisExpr> for Box<Expr>

source§

fn from(src: ThisExpr) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<ThisExpr> for Expr

source§

fn from(v: ThisExpr) -> Self

Converts to this type from the input type.
source§

impl From<Tpl> for Box<Expr>

source§

fn from(src: Tpl) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<Tpl> for Expr

source§

fn from(v: Tpl) -> Self

Converts to this type from the input type.
source§

impl From<TsAsExpr> for Box<Expr>

source§

fn from(src: TsAsExpr) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<TsAsExpr> for Expr

source§

fn from(v: TsAsExpr) -> Self

Converts to this type from the input type.
source§

impl From<TsConstAssertion> for Box<Expr>

source§

fn from(src: TsConstAssertion) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<TsConstAssertion> for Expr

source§

fn from(v: TsConstAssertion) -> Self

Converts to this type from the input type.
source§

impl From<TsInstantiation> for Box<Expr>

source§

fn from(src: TsInstantiation) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<TsInstantiation> for Expr

source§

fn from(v: TsInstantiation) -> Self

Converts to this type from the input type.
source§

impl From<TsNonNullExpr> for Box<Expr>

source§

fn from(src: TsNonNullExpr) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<TsNonNullExpr> for Expr

source§

fn from(v: TsNonNullExpr) -> Self

Converts to this type from the input type.
source§

impl From<TsSatisfiesExpr> for Box<Expr>

source§

fn from(src: TsSatisfiesExpr) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<TsSatisfiesExpr> for Expr

source§

fn from(v: TsSatisfiesExpr) -> Self

Converts to this type from the input type.
source§

impl From<TsTypeAssertion> for Box<Expr>

source§

fn from(src: TsTypeAssertion) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<TsTypeAssertion> for Expr

source§

fn from(v: TsTypeAssertion) -> Self

Converts to this type from the input type.
source§

impl From<UnaryExpr> for Box<Expr>

source§

fn from(src: UnaryExpr) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<UnaryExpr> for Expr

source§

fn from(v: UnaryExpr) -> Self

Converts to this type from the input type.
source§

impl From<UpdateExpr> for Box<Expr>

source§

fn from(src: UpdateExpr) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<UpdateExpr> for Expr

source§

fn from(v: UpdateExpr) -> Self

Converts to this type from the input type.
source§

impl From<YieldExpr> for Box<Expr>

source§

fn from(src: YieldExpr) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<YieldExpr> for Expr

source§

fn from(v: YieldExpr) -> Self

Converts to this type from the input type.
source§

impl From<bool> for Box<Expr>

source§

fn from(src: bool) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<bool> for Expr

source§

fn from(src: bool) -> Expr

Converts to this type from the input type.
source§

impl From<f64> for Box<Expr>

source§

fn from(src: f64) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<f64> for Expr

source§

fn from(src: f64) -> Expr

Converts to this type from the input type.
source§

impl From<usize> for Box<Expr>

source§

fn from(src: usize) -> Box<Expr>

Converts to this type from the input type.
source§

impl From<usize> for Expr

source§

fn from(src: usize) -> Expr

Converts to this type from the input type.
source§

impl Hash for Expr

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

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

impl PartialEq for Expr

source§

fn eq(&self, other: &Expr) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<__S> Serialize<__S> for Expr
where __S: ScratchSpace + Serializer + Fallible + ?Sized,

source§

fn serialize( &self, serializer: &mut __S, ) -> Result<<Self as Archive>::Resolver, __S::Error>

Writes the dependencies for the object and returns a resolver that can create the archived type.
source§

impl Serialize for Expr

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Spanned for Expr

source§

fn span(&self) -> Span

Get span of self.
source§

fn span_lo(&self) -> BytePos

source§

fn span_hi(&self) -> BytePos

source§

impl Take for Expr

source§

fn dummy() -> Self

Create a dummy value of this type.
source§

fn take(&mut self) -> Self

source§

fn map_with_mut<F>(&mut self, op: F)
where F: FnOnce(Self) -> Self,

Mutate self using op, which accepts owned data.
source§

impl Eq for Expr

source§

impl StructuralPartialEq for Expr

Auto Trait Implementations§

§

impl Freeze for Expr

§

impl RefUnwindSafe for Expr

§

impl Send for Expr

§

impl Sync for Expr

§

impl Unpin for Expr

§

impl UnwindSafe for Expr

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> ArchivePointee for T

§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
§

impl<T> ArchiveUnsized for T
where T: Archive,

§

type Archived = <T as Archive>::Archived

The archived counterpart of this type. Unlike Archive, it may be unsized. Read more
§

type MetadataResolver = ()

The resolver for the metadata of this type. Read more
§

unsafe fn resolve_metadata( &self, _: usize, _: <T as ArchiveUnsized>::MetadataResolver, _: *mut <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata, )

Creates the archived version of the metadata for this value at the given position and writes it to the given output. Read more
§

unsafe fn resolve_unsized( &self, from: usize, to: usize, resolver: Self::MetadataResolver, out: *mut RelPtr<Self::Archived, <isize as Archive>::Archived>, )

Resolves a relative pointer to this value with the given from and to and writes it to the given output. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CallHasher for T
where T: Hash + ?Sized,

§

default fn get_hash<H, B>(value: &H, build_hasher: &B) -> u64
where H: Hash + ?Sized, B: BuildHasher,

source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<T> Conv for T

§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
§

impl<F, W, T, D> Deserialize<With<T, W>, D> for F
where W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,

§

fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>

Deserializes using the given deserializer
§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<T> FmtForward for T

§

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
§

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
§

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
§

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
§

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> LayoutRaw for T

§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Gets the layout of the type.
§

impl<T> Pipe for T
where T: ?Sized,

§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows self, then passes self.as_ref() into the pipe function.
§

fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.as_mut() into the pipe function.
§

fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R, ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
§

impl<T> Pointee for T

§

type Metadata = ()

The type for metadata in pointers and references to Self.
§

impl<T, S> SerializeUnsized<S> for T
where T: Serialize<S>, S: Serializer + ?Sized,

§

fn serialize_unsized( &self, serializer: &mut S, ) -> Result<usize, <S as Fallible>::Error>

Writes the object and returns the position of the archived type.
§

fn serialize_metadata(&self, _: &mut S) -> Result<(), <S as Fallible>::Error>

Serializes the metadata for the given type.
source§

impl<T> SpanExt for T
where T: Spanned,

source§

fn is_synthesized(&self) -> bool

source§

fn starts_on_new_line(&self, format: ListFormat) -> bool

source§

fn comment_range(&self) -> Span

Gets a custom text range to use when emitting comments.
§

impl<T> Tap for T

§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Calls .tap_borrow() only in debug builds, and is erased in release builds.
§

fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds.
§

fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Calls .tap_ref() only in debug builds, and is erased in release builds.
§

fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Calls .tap_ref_mut() only in debug builds, and is erased in release builds.
§

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T> TryConv for T

§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,