swc_core::ecma::utils::swc_ecma_ast

Enum Expr

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),
}
Available on crate features __ecma and __utils only.

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§

§

impl Expr

pub const fn is_this(&self) -> bool

Available on crate feature ecma_ast only.

Returns true if self is of variant This.

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

Available on crate feature ecma_ast only.

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

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

Available on crate feature ecma_ast only.

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

pub fn expect_this(self) -> ThisExpr
where Expr: Debug,

Available on crate feature ecma_ast only.

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>

Available on crate feature ecma_ast only.

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

pub const fn is_array(&self) -> bool

Available on crate feature ecma_ast only.

Returns true if self is of variant Array.

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

Available on crate feature ecma_ast only.

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

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

Available on crate feature ecma_ast only.

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

pub fn expect_array(self) -> ArrayLit
where Expr: Debug,

Available on crate feature ecma_ast only.

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>

Available on crate feature ecma_ast only.

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

pub const fn is_object(&self) -> bool

Available on crate feature ecma_ast only.

Returns true if self is of variant Object.

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

Available on crate feature ecma_ast only.

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

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

Available on crate feature ecma_ast only.

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

pub fn expect_object(self) -> ObjectLit
where Expr: Debug,

Available on crate feature ecma_ast only.

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>

Available on crate feature ecma_ast only.

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

pub const fn is_fn_expr(&self) -> bool

Available on crate feature ecma_ast only.

Returns true if self is of variant Fn.

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

Available on crate feature ecma_ast only.

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

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

Available on crate feature ecma_ast only.

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

pub fn expect_fn_expr(self) -> FnExpr
where Expr: Debug,

Available on crate feature ecma_ast only.

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>

Available on crate feature ecma_ast only.

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

pub const fn is_unary(&self) -> bool

Available on crate feature ecma_ast only.

Returns true if self is of variant Unary.

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

Available on crate feature ecma_ast only.

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

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

Available on crate feature ecma_ast only.

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

pub fn expect_unary(self) -> UnaryExpr
where Expr: Debug,

Available on crate feature ecma_ast only.

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>

Available on crate feature ecma_ast only.

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

pub const fn is_update(&self) -> bool

Available on crate feature ecma_ast only.

Returns true if self is of variant Update.

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

Available on crate feature ecma_ast only.

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

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

Available on crate feature ecma_ast only.

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

pub fn expect_update(self) -> UpdateExpr
where Expr: Debug,

Available on crate feature ecma_ast only.

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>

Available on crate feature ecma_ast only.

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

pub const fn is_bin(&self) -> bool

Available on crate feature ecma_ast only.

Returns true if self is of variant Bin.

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

Available on crate feature ecma_ast only.

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

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

Available on crate feature ecma_ast only.

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

pub fn expect_bin(self) -> BinExpr
where Expr: Debug,

Available on crate feature ecma_ast only.

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>

Available on crate feature ecma_ast only.

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

pub const fn is_assign(&self) -> bool

Available on crate feature ecma_ast only.

Returns true if self is of variant Assign.

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

Available on crate feature ecma_ast only.

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

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

Available on crate feature ecma_ast only.

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

pub fn expect_assign(self) -> AssignExpr
where Expr: Debug,

Available on crate feature ecma_ast only.

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>

Available on crate feature ecma_ast only.

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

pub const fn is_member(&self) -> bool

Available on crate feature ecma_ast only.

Returns true if self is of variant Member.

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

Available on crate feature ecma_ast only.

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

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

Available on crate feature ecma_ast only.

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

pub fn expect_member(self) -> MemberExpr
where Expr: Debug,

Available on crate feature ecma_ast only.

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>

Available on crate feature ecma_ast only.

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

pub const fn is_super_prop(&self) -> bool

Available on crate feature ecma_ast only.

Returns true if self is of variant SuperProp.

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

Available on crate feature ecma_ast only.

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

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

Available on crate feature ecma_ast only.

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

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

Available on crate feature ecma_ast only.

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.

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

Available on crate feature ecma_ast only.

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

pub const fn is_cond(&self) -> bool

Available on crate feature ecma_ast only.

Returns true if self is of variant Cond.

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

Available on crate feature ecma_ast only.

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

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

Available on crate feature ecma_ast only.

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

pub fn expect_cond(self) -> CondExpr
where Expr: Debug,

Available on crate feature ecma_ast only.

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>

Available on crate feature ecma_ast only.

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

pub const fn is_call(&self) -> bool

Available on crate feature ecma_ast only.

Returns true if self is of variant Call.

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

Available on crate feature ecma_ast only.

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

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

Available on crate feature ecma_ast only.

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

pub fn expect_call(self) -> CallExpr
where Expr: Debug,

Available on crate feature ecma_ast only.

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>

Available on crate feature ecma_ast only.

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

pub const fn is_new(&self) -> bool

Available on crate feature ecma_ast only.

Returns true if self is of variant New.

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

Available on crate feature ecma_ast only.

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

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

Available on crate feature ecma_ast only.

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

pub fn expect_new(self) -> NewExpr
where Expr: Debug,

Available on crate feature ecma_ast only.

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>

Available on crate feature ecma_ast only.

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

pub const fn is_seq(&self) -> bool

Available on crate feature ecma_ast only.

Returns true if self is of variant Seq.

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

Available on crate feature ecma_ast only.

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

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

Available on crate feature ecma_ast only.

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

pub fn expect_seq(self) -> SeqExpr
where Expr: Debug,

Available on crate feature ecma_ast only.

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>

Available on crate feature ecma_ast only.

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

pub const fn is_ident(&self) -> bool

Available on crate feature ecma_ast only.

Returns true if self is of variant Ident.

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

Available on crate feature ecma_ast only.

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

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

Available on crate feature ecma_ast only.

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

pub fn expect_ident(self) -> Ident
where Expr: Debug,

Available on crate feature ecma_ast only.

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>

Available on crate feature ecma_ast only.

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

pub const fn is_lit(&self) -> bool

Available on crate feature ecma_ast only.

Returns true if self is of variant Lit.

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

Available on crate feature ecma_ast only.

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

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

Available on crate feature ecma_ast only.

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

pub fn expect_lit(self) -> Lit
where Expr: Debug,

Available on crate feature ecma_ast only.

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>

Available on crate feature ecma_ast only.

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

pub const fn is_tpl(&self) -> bool

Available on crate feature ecma_ast only.

Returns true if self is of variant Tpl.

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

Available on crate feature ecma_ast only.

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

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

Available on crate feature ecma_ast only.

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

pub fn expect_tpl(self) -> Tpl
where Expr: Debug,

Available on crate feature ecma_ast only.

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>

Available on crate feature ecma_ast only.

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

pub const fn is_tagged_tpl(&self) -> bool

Available on crate feature ecma_ast only.

Returns true if self is of variant TaggedTpl.

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

Available on crate feature ecma_ast only.

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

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

Available on crate feature ecma_ast only.

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

pub fn expect_tagged_tpl(self) -> TaggedTpl
where Expr: Debug,

Available on crate feature ecma_ast only.

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>

Available on crate feature ecma_ast only.

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

pub const fn is_arrow(&self) -> bool

Available on crate feature ecma_ast only.

Returns true if self is of variant Arrow.

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

Available on crate feature ecma_ast only.

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

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

Available on crate feature ecma_ast only.

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

pub fn expect_arrow(self) -> ArrowExpr
where Expr: Debug,

Available on crate feature ecma_ast only.

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>

Available on crate feature ecma_ast only.

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

pub const fn is_class(&self) -> bool

Available on crate feature ecma_ast only.

Returns true if self is of variant Class.

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

Available on crate feature ecma_ast only.

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

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

Available on crate feature ecma_ast only.

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

pub fn expect_class(self) -> ClassExpr
where Expr: Debug,

Available on crate feature ecma_ast only.

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>

Available on crate feature ecma_ast only.

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

pub const fn is_yield_expr(&self) -> bool

Available on crate feature ecma_ast only.

Returns true if self is of variant Yield.

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

Available on crate feature ecma_ast only.

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

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

Available on crate feature ecma_ast only.

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

pub fn expect_yield_expr(self) -> YieldExpr
where Expr: Debug,

Available on crate feature ecma_ast only.

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>

Available on crate feature ecma_ast only.

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

pub const fn is_meta_prop(&self) -> bool

Available on crate feature ecma_ast only.

Returns true if self is of variant MetaProp.

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

Available on crate feature ecma_ast only.

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

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

Available on crate feature ecma_ast only.

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

pub fn expect_meta_prop(self) -> MetaPropExpr
where Expr: Debug,

Available on crate feature ecma_ast only.

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>

Available on crate feature ecma_ast only.

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

pub const fn is_await_expr(&self) -> bool

Available on crate feature ecma_ast only.

Returns true if self is of variant Await.

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

Available on crate feature ecma_ast only.

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

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

Available on crate feature ecma_ast only.

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

pub fn expect_await_expr(self) -> AwaitExpr
where Expr: Debug,

Available on crate feature ecma_ast only.

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>

Available on crate feature ecma_ast only.

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

pub const fn is_paren(&self) -> bool

Available on crate feature ecma_ast only.

Returns true if self is of variant Paren.

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

Available on crate feature ecma_ast only.

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

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

Available on crate feature ecma_ast only.

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

pub fn expect_paren(self) -> ParenExpr
where Expr: Debug,

Available on crate feature ecma_ast only.

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>

Available on crate feature ecma_ast only.

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

pub const fn is_jsx_member(&self) -> bool

Available on crate feature ecma_ast only.

Returns true if self is of variant JSXMember.

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

Available on crate feature ecma_ast only.

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

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

Available on crate feature ecma_ast only.

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

pub fn expect_jsx_member(self) -> JSXMemberExpr
where Expr: Debug,

Available on crate feature ecma_ast only.

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>

Available on crate feature ecma_ast only.

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

pub const fn is_jsx_namespaced_name(&self) -> bool

Available on crate feature ecma_ast only.

Returns true if self is of variant JSXNamespacedName.

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

Available on crate feature ecma_ast only.

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

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

Available on crate feature ecma_ast only.

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

pub fn expect_jsx_namespaced_name(self) -> JSXNamespacedName
where Expr: Debug,

Available on crate feature ecma_ast only.

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>

Available on crate feature ecma_ast only.

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

pub const fn is_jsx_empty(&self) -> bool

Available on crate feature ecma_ast only.

Returns true if self is of variant JSXEmpty.

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

Available on crate feature ecma_ast only.

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

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

Available on crate feature ecma_ast only.

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

pub fn expect_jsx_empty(self) -> JSXEmptyExpr
where Expr: Debug,

Available on crate feature ecma_ast only.

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>

Available on crate feature ecma_ast only.

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

pub const fn is_jsx_element(&self) -> bool

Available on crate feature ecma_ast only.

Returns true if self is of variant JSXElement.

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

Available on crate feature ecma_ast only.

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

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

Available on crate feature ecma_ast only.

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

pub fn expect_jsx_element(self) -> Box<JSXElement>
where Expr: Debug,

Available on crate feature ecma_ast only.

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>>

Available on crate feature ecma_ast only.

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

pub const fn is_jsx_fragment(&self) -> bool

Available on crate feature ecma_ast only.

Returns true if self is of variant JSXFragment.

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

Available on crate feature ecma_ast only.

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

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

Available on crate feature ecma_ast only.

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

pub fn expect_jsx_fragment(self) -> JSXFragment
where Expr: Debug,

Available on crate feature ecma_ast only.

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>

Available on crate feature ecma_ast only.

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

pub const fn is_ts_type_assertion(&self) -> bool

Available on crate feature ecma_ast only.

Returns true if self is of variant TsTypeAssertion.

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

Available on crate feature ecma_ast only.

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

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

Available on crate feature ecma_ast only.

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

pub fn expect_ts_type_assertion(self) -> TsTypeAssertion
where Expr: Debug,

Available on crate feature ecma_ast only.

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>

Available on crate feature ecma_ast only.

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

pub const fn is_ts_const_assertion(&self) -> bool

Available on crate feature ecma_ast only.

Returns true if self is of variant TsConstAssertion.

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

Available on crate feature ecma_ast only.

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

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

Available on crate feature ecma_ast only.

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

pub fn expect_ts_const_assertion(self) -> TsConstAssertion
where Expr: Debug,

Available on crate feature ecma_ast only.

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>

Available on crate feature ecma_ast only.

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

pub const fn is_ts_non_null(&self) -> bool

Available on crate feature ecma_ast only.

Returns true if self is of variant TsNonNull.

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

Available on crate feature ecma_ast only.

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

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

Available on crate feature ecma_ast only.

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

pub fn expect_ts_non_null(self) -> TsNonNullExpr
where Expr: Debug,

Available on crate feature ecma_ast only.

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>

Available on crate feature ecma_ast only.

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

pub const fn is_ts_as(&self) -> bool

Available on crate feature ecma_ast only.

Returns true if self is of variant TsAs.

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

Available on crate feature ecma_ast only.

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

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

Available on crate feature ecma_ast only.

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

pub fn expect_ts_as(self) -> TsAsExpr
where Expr: Debug,

Available on crate feature ecma_ast only.

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>

Available on crate feature ecma_ast only.

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

pub const fn is_ts_instantiation(&self) -> bool

Available on crate feature ecma_ast only.

Returns true if self is of variant TsInstantiation.

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

Available on crate feature ecma_ast only.

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

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

Available on crate feature ecma_ast only.

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

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

Available on crate feature ecma_ast only.

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.

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

Available on crate feature ecma_ast only.

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

pub const fn is_ts_satisfies(&self) -> bool

Available on crate feature ecma_ast only.

Returns true if self is of variant TsSatisfies.

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

Available on crate feature ecma_ast only.

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

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

Available on crate feature ecma_ast only.

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

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

Available on crate feature ecma_ast only.

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.

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

Available on crate feature ecma_ast only.

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

pub const fn is_private_name(&self) -> bool

Available on crate feature ecma_ast only.

Returns true if self is of variant PrivateName.

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

Available on crate feature ecma_ast only.

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

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

Available on crate feature ecma_ast only.

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

pub fn expect_private_name(self) -> PrivateName
where Expr: Debug,

Available on crate feature ecma_ast only.

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>

Available on crate feature ecma_ast only.

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

pub const fn is_opt_chain(&self) -> bool

Available on crate feature ecma_ast only.

Returns true if self is of variant OptChain.

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

Available on crate feature ecma_ast only.

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

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

Available on crate feature ecma_ast only.

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

pub fn expect_opt_chain(self) -> OptChainExpr
where Expr: Debug,

Available on crate feature ecma_ast only.

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>

Available on crate feature ecma_ast only.

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

pub const fn is_invalid(&self) -> bool

Available on crate feature ecma_ast only.

Returns true if self is of variant Invalid.

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

Available on crate feature ecma_ast only.

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

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

Available on crate feature ecma_ast only.

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

pub fn expect_invalid(self) -> Invalid
where Expr: Debug,

Available on crate feature ecma_ast only.

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>

Available on crate feature ecma_ast only.

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

§

impl Expr

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

Available on crate feature ecma_ast only.

Creates void 0.

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

Available on crate feature ecma_ast only.

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

Available on crate feature ecma_ast only.

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

Available on crate feature ecma_ast only.

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.

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>,

Available on crate feature ecma_ast only.

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.

pub fn unwrap_parens(&self) -> &Expr

Available on crate feature ecma_ast only.

Normalize parenthesized expressions.

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

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

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

Available on crate feature ecma_ast only.

Normalize parenthesized expressions.

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

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

pub fn unwrap_seqs_and_parens(&self) -> &Expr

Available on crate feature ecma_ast only.

Normalize sequences and parenthesized expressions.

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

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

Available on crate feature ecma_ast only.

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.

pub fn directness_maters(&self) -> bool

Available on crate feature ecma_ast only.

Returns true for eval and member expressions.

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

Available on crate feature ecma_ast only.

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

Available on crate feature ecma_ast only.

Trait Implementations§

§

impl Archive for Expr

§

type Archived = ArchivedExpr

The archived representation of this type. Read more
§

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.
§

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

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

impl Clone for Expr

§

fn clone(&self) -> Expr

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
§

impl Debug for Expr

§

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

Formats the value using the given formatter. Read more
§

impl Default for Expr

§

fn default() -> Expr

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

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

§

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

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

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

§

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

Deserializes using the given deserializer
§

impl EndsWithAlphaNum for Expr

§

impl EqIgnoreSpan for Expr

§

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

§

impl ExprExt for Box<Expr>

§

fn as_expr(&self) -> &Expr

§

fn is_immutable_value(&self) -> bool

Returns true if this is an immutable value.
§

fn is_number(&self) -> bool

§

fn is_str(&self) -> bool

§

fn is_array_lit(&self) -> bool

§

fn is_nan(&self) -> bool

Checks if self is NaN.
§

fn is_undefined(&self, ctx: &ExprCtx) -> bool

§

fn is_void(&self) -> bool

§

fn is_global_ref_to(&self, ctx: &ExprCtx, id: &str) -> bool

Returns true if id references a global object.
§

fn is_one_of_global_ref_to(&self, ctx: &ExprCtx, ids: &[&str]) -> bool

Returns true if id references a global object.
§

fn as_pure_bool(&self, ctx: &ExprCtx) -> Value<bool>

Get bool value of self if it does not have any side effects.
§

fn cast_to_bool(&self, ctx: &ExprCtx) -> (Purity, Value<bool>)

This method emulates the Boolean() JavaScript cast function. Note: unlike getPureBooleanValue this function does not return None for expressions with side-effects.
§

fn cast_to_number(&self, ctx: &ExprCtx) -> (Purity, Value<f64>)

§

fn as_pure_number(&self, ctx: &ExprCtx) -> Value<f64>

Emulates javascript Number() cast function. Read more
§

fn as_pure_string(&self, ctx: &ExprCtx) -> Value<Cow<'_, str>>

Returns Known only if it’s pure.
§

fn get_type(&self) -> Value<Type>

Apply the supplied predicate against all possible result Nodes of the expression.
§

fn is_pure_callee(&self, ctx: &ExprCtx) -> bool

§

fn may_have_side_effects(&self, ctx: &ExprCtx) -> bool

§

impl ExprExt for Expr

§

fn as_expr(&self) -> &Expr

§

fn is_immutable_value(&self) -> bool

Returns true if this is an immutable value.
§

fn is_number(&self) -> bool

§

fn is_str(&self) -> bool

§

fn is_array_lit(&self) -> bool

§

fn is_nan(&self) -> bool

Checks if self is NaN.
§

fn is_undefined(&self, ctx: &ExprCtx) -> bool

§

fn is_void(&self) -> bool

§

fn is_global_ref_to(&self, ctx: &ExprCtx, id: &str) -> bool

Returns true if id references a global object.
§

fn is_one_of_global_ref_to(&self, ctx: &ExprCtx, ids: &[&str]) -> bool

Returns true if id references a global object.
§

fn as_pure_bool(&self, ctx: &ExprCtx) -> Value<bool>

Get bool value of self if it does not have any side effects.
§

fn cast_to_bool(&self, ctx: &ExprCtx) -> (Purity, Value<bool>)

This method emulates the Boolean() JavaScript cast function. Note: unlike getPureBooleanValue this function does not return None for expressions with side-effects.
§

fn cast_to_number(&self, ctx: &ExprCtx) -> (Purity, Value<f64>)

§

fn as_pure_number(&self, ctx: &ExprCtx) -> Value<f64>

Emulates javascript Number() cast function. Read more
§

fn as_pure_string(&self, ctx: &ExprCtx) -> Value<Cow<'_, str>>

Returns Known only if it’s pure.
§

fn get_type(&self) -> Value<Type>

Apply the supplied predicate against all possible result Nodes of the expression.
§

fn is_pure_callee(&self, ctx: &ExprCtx) -> bool

§

fn may_have_side_effects(&self, ctx: &ExprCtx) -> bool

§

impl<V> FoldWith<V> for Expr
where V: Fold + ?Sized,

§

fn fold_with(self, visitor: &mut V) -> Expr

Calls Fold::fold_expr with self.

§

fn fold_children_with(self, visitor: &mut V) -> Expr

Visit children nodes of self`` with visitor`.
§

impl<'ast> From<&'ast Expr> for NodeRef<'ast>

§

fn from(node: &'ast Expr) -> NodeRef<'ast>

Converts to this type from the input type.
§

impl From<&str> for Box<Expr>

§

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

Converts to this type from the input type.
§

impl From<&str> for Expr

§

fn from(src: &str) -> Expr

Converts to this type from the input type.
§

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

§

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

Converts to this type from the input type.
§

impl From<(Atom, SyntaxContext)> for Expr

§

fn from(src: (Atom, SyntaxContext)) -> Expr

Converts to this type from the input type.
§

impl From<ArrayLit> for Box<Expr>

§

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

Converts to this type from the input type.
§

impl From<ArrayLit> for Expr

§

fn from(v: ArrayLit) -> Expr

Converts to this type from the input type.
§

impl From<ArrowExpr> for Box<Expr>

§

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

Converts to this type from the input type.
§

impl From<ArrowExpr> for Expr

§

fn from(v: ArrowExpr) -> Expr

Converts to this type from the input type.
§

impl From<AssignExpr> for Box<Expr>

§

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

Converts to this type from the input type.
§

impl From<AssignExpr> for Expr

§

fn from(v: AssignExpr) -> Expr

Converts to this type from the input type.
§

impl From<Atom> for Box<Expr>

§

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

Converts to this type from the input type.
§

impl From<Atom> for Expr

§

fn from(src: Atom) -> Expr

Converts to this type from the input type.
§

impl From<AwaitExpr> for Box<Expr>

§

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

Converts to this type from the input type.
§

impl From<AwaitExpr> for Expr

§

fn from(v: AwaitExpr) -> Expr

Converts to this type from the input type.
§

impl From<BigInt> for Box<Expr>

§

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

Converts to this type from the input type.
§

impl From<BigInt> for Expr

§

fn from(src: BigInt) -> Expr

Converts to this type from the input type.
§

impl From<BigInt> for Box<Expr>

§

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

Converts to this type from the input type.
§

impl From<BigInt> for Expr

§

fn from(src: BigInt) -> Expr

Converts to this type from the input type.
§

impl From<BinExpr> for Box<Expr>

§

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

Converts to this type from the input type.
§

impl From<BinExpr> for Expr

§

fn from(v: BinExpr) -> Expr

Converts to this type from the input type.
§

impl From<BindingIdent> for Box<Expr>

§

fn from(bi: BindingIdent) -> Box<Expr>

Converts to this type from the input type.
§

impl From<Bool> for Box<Expr>

§

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

Converts to this type from the input type.
§

impl From<Bool> for Expr

§

fn from(src: Bool) -> Expr

Converts to this type from the input type.
§

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

§

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

Converts to this type from the input type.
§

impl From<Box<Class>> for Expr

§

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

Converts to this type from the input type.
§

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

§

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

Converts to this type from the input type.
§

impl From<Box<Function>> for Expr

§

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

Converts to this type from the input type.
§

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

§

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

Converts to this type from the input type.
§

impl From<Box<JSXElement>> for Expr

§

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

Converts to this type from the input type.
§

impl From<CallExpr> for Box<Expr>

§

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

Converts to this type from the input type.
§

impl From<CallExpr> for Expr

§

fn from(v: CallExpr) -> Expr

Converts to this type from the input type.
§

impl From<Class> for Box<Expr>

§

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

Converts to this type from the input type.
§

impl From<Class> for Expr

§

fn from(src: Class) -> Expr

Converts to this type from the input type.
§

impl From<ClassExpr> for Box<Expr>

§

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

Converts to this type from the input type.
§

impl From<ClassExpr> for Expr

§

fn from(v: ClassExpr) -> Expr

Converts to this type from the input type.
§

impl From<CondExpr> for Box<Expr>

§

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

Converts to this type from the input type.
§

impl From<CondExpr> for Expr

§

fn from(v: CondExpr) -> Expr

Converts to this type from the input type.
§

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

§

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

Converts to this type from the input type.
§

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

§

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

Converts to this type from the input type.
§

impl From<Expr> for ExprOrSpread

§

fn from(src: Expr) -> ExprOrSpread

Converts to this type from the input type.
§

impl From<Expr> for VarDeclOrExpr

§

fn from(src: Expr) -> VarDeclOrExpr

Converts to this type from the input type.
§

impl From<FnExpr> for Box<Expr>

§

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

Converts to this type from the input type.
§

impl From<FnExpr> for Expr

§

fn from(v: FnExpr) -> Expr

Converts to this type from the input type.
§

impl From<Function> for Box<Expr>

§

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

Converts to this type from the input type.
§

impl From<Function> for Expr

§

fn from(src: Function) -> Expr

Converts to this type from the input type.
§

impl From<Ident> for Box<Expr>

§

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

Converts to this type from the input type.
§

impl From<Ident> for Expr

§

fn from(v: Ident) -> Expr

Converts to this type from the input type.
§

impl From<IdentName> for Box<Expr>

§

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

Converts to this type from the input type.
§

impl From<IdentName> for Expr

§

fn from(src: IdentName) -> Expr

Converts to this type from the input type.
§

impl From<Invalid> for Box<Expr>

§

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

Converts to this type from the input type.
§

impl From<Invalid> for Expr

§

fn from(v: Invalid) -> Expr

Converts to this type from the input type.
§

impl From<JSXElement> for Box<Expr>

§

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

Converts to this type from the input type.
§

impl From<JSXEmptyExpr> for Box<Expr>

§

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

Converts to this type from the input type.
§

impl From<JSXEmptyExpr> for Expr

§

fn from(v: JSXEmptyExpr) -> Expr

Converts to this type from the input type.
§

impl From<JSXFragment> for Box<Expr>

§

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

Converts to this type from the input type.
§

impl From<JSXFragment> for Expr

§

fn from(v: JSXFragment) -> Expr

Converts to this type from the input type.
§

impl From<JSXMemberExpr> for Box<Expr>

§

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

Converts to this type from the input type.
§

impl From<JSXMemberExpr> for Expr

§

fn from(v: JSXMemberExpr) -> Expr

Converts to this type from the input type.
§

impl From<JSXNamespacedName> for Box<Expr>

§

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

Converts to this type from the input type.
§

impl From<JSXNamespacedName> for Expr

§

fn from(v: JSXNamespacedName) -> Expr

Converts to this type from the input type.
§

impl From<JSXText> for Box<Expr>

§

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

Converts to this type from the input type.
§

impl From<JSXText> for Expr

§

fn from(src: JSXText) -> Expr

Converts to this type from the input type.
§

impl From<Lit> for Box<Expr>

§

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

Converts to this type from the input type.
§

impl From<Lit> for Expr

§

fn from(v: Lit) -> Expr

Converts to this type from the input type.
§

impl From<MemberExpr> for Box<Expr>

§

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

Converts to this type from the input type.
§

impl From<MemberExpr> for Expr

§

fn from(v: MemberExpr) -> Expr

Converts to this type from the input type.
§

impl From<MetaPropExpr> for Box<Expr>

§

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

Converts to this type from the input type.
§

impl From<MetaPropExpr> for Expr

§

fn from(v: MetaPropExpr) -> Expr

Converts to this type from the input type.
§

impl From<NewExpr> for Box<Expr>

§

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

Converts to this type from the input type.
§

impl From<NewExpr> for Expr

§

fn from(v: NewExpr) -> Expr

Converts to this type from the input type.
§

impl From<Null> for Box<Expr>

§

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

Converts to this type from the input type.
§

impl From<Null> for Expr

§

fn from(src: Null) -> Expr

Converts to this type from the input type.
§

impl From<Number> for Box<Expr>

§

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

Converts to this type from the input type.
§

impl From<Number> for Expr

§

fn from(src: Number) -> Expr

Converts to this type from the input type.
§

impl From<ObjectLit> for Box<Expr>

§

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

Converts to this type from the input type.
§

impl From<ObjectLit> for Expr

§

fn from(v: ObjectLit) -> Expr

Converts to this type from the input type.
§

impl From<OptCall> for Box<Expr>

§

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

Converts to this type from the input type.
§

impl From<OptCall> for Expr

§

fn from(src: OptCall) -> Expr

Converts to this type from the input type.
§

impl From<OptChainBase> for Expr

§

fn from(opt: OptChainBase) -> Expr

Converts to this type from the input type.
§

impl From<OptChainExpr> for Box<Expr>

§

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

Converts to this type from the input type.
§

impl From<OptChainExpr> for Expr

§

fn from(v: OptChainExpr) -> Expr

Converts to this type from the input type.
§

impl From<ParenExpr> for Box<Expr>

§

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

Converts to this type from the input type.
§

impl From<ParenExpr> for Expr

§

fn from(v: ParenExpr) -> Expr

Converts to this type from the input type.
§

impl From<PrivateName> for Box<Expr>

§

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

Converts to this type from the input type.
§

impl From<PrivateName> for Expr

§

fn from(v: PrivateName) -> Expr

Converts to this type from the input type.
§

impl From<Regex> for Box<Expr>

§

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

Converts to this type from the input type.
§

impl From<Regex> for Expr

§

fn from(src: Regex) -> Expr

Converts to this type from the input type.
§

impl From<SeqExpr> for Box<Expr>

§

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

Converts to this type from the input type.
§

impl From<SeqExpr> for Expr

§

fn from(v: SeqExpr) -> Expr

Converts to this type from the input type.
§

impl From<SimpleAssignTarget> for Box<Expr>

§

fn from(s: SimpleAssignTarget) -> Box<Expr>

Converts to this type from the input type.
§

impl From<Str> for Box<Expr>

§

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

Converts to this type from the input type.
§

impl From<Str> for Expr

§

fn from(src: Str) -> Expr

Converts to this type from the input type.
§

impl From<String> for Box<Expr>

§

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

Converts to this type from the input type.
§

impl From<String> for Expr

§

fn from(src: String) -> Expr

Converts to this type from the input type.
§

impl From<SuperPropExpr> for Box<Expr>

§

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

Converts to this type from the input type.
§

impl From<SuperPropExpr> for Expr

§

fn from(v: SuperPropExpr) -> Expr

Converts to this type from the input type.
§

impl From<TaggedTpl> for Box<Expr>

§

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

Converts to this type from the input type.
§

impl From<TaggedTpl> for Expr

§

fn from(v: TaggedTpl) -> Expr

Converts to this type from the input type.
§

impl From<ThisExpr> for Box<Expr>

§

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

Converts to this type from the input type.
§

impl From<ThisExpr> for Expr

§

fn from(v: ThisExpr) -> Expr

Converts to this type from the input type.
§

impl From<Tpl> for Box<Expr>

§

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

Converts to this type from the input type.
§

impl From<Tpl> for Expr

§

fn from(v: Tpl) -> Expr

Converts to this type from the input type.
§

impl From<TsAsExpr> for Box<Expr>

§

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

Converts to this type from the input type.
§

impl From<TsAsExpr> for Expr

§

fn from(v: TsAsExpr) -> Expr

Converts to this type from the input type.
§

impl From<TsConstAssertion> for Box<Expr>

§

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

Converts to this type from the input type.
§

impl From<TsConstAssertion> for Expr

§

fn from(v: TsConstAssertion) -> Expr

Converts to this type from the input type.
§

impl From<TsEnumRecordValue> for Expr

§

fn from(value: TsEnumRecordValue) -> Expr

Converts to this type from the input type.
§

impl From<TsInstantiation> for Box<Expr>

§

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

Converts to this type from the input type.
§

impl From<TsInstantiation> for Expr

§

fn from(v: TsInstantiation) -> Expr

Converts to this type from the input type.
§

impl From<TsNonNullExpr> for Box<Expr>

§

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

Converts to this type from the input type.
§

impl From<TsNonNullExpr> for Expr

§

fn from(v: TsNonNullExpr) -> Expr

Converts to this type from the input type.
§

impl From<TsSatisfiesExpr> for Box<Expr>

§

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

Converts to this type from the input type.
§

impl From<TsSatisfiesExpr> for Expr

§

fn from(v: TsSatisfiesExpr) -> Expr

Converts to this type from the input type.
§

impl From<TsTypeAssertion> for Box<Expr>

§

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

Converts to this type from the input type.
§

impl From<TsTypeAssertion> for Expr

§

fn from(v: TsTypeAssertion) -> Expr

Converts to this type from the input type.
§

impl From<UnaryExpr> for Box<Expr>

§

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

Converts to this type from the input type.
§

impl From<UnaryExpr> for Expr

§

fn from(v: UnaryExpr) -> Expr

Converts to this type from the input type.
§

impl From<UpdateExpr> for Box<Expr>

§

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

Converts to this type from the input type.
§

impl From<UpdateExpr> for Expr

§

fn from(v: UpdateExpr) -> Expr

Converts to this type from the input type.
§

impl From<YieldExpr> for Box<Expr>

§

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

Converts to this type from the input type.
§

impl From<YieldExpr> for Expr

§

fn from(v: YieldExpr) -> Expr

Converts to this type from the input type.
§

impl From<bool> for Box<Expr>

§

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

Converts to this type from the input type.
§

impl From<bool> for Expr

§

fn from(src: bool) -> Expr

Converts to this type from the input type.
§

impl From<f64> for Box<Expr>

§

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

Converts to this type from the input type.
§

impl From<f64> for Expr

§

fn from(src: f64) -> Expr

Converts to this type from the input type.
§

impl From<usize> for Box<Expr>

§

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

Converts to this type from the input type.
§

impl From<usize> for Expr

§

fn from(src: usize) -> Expr

Converts to this type from the input type.
§

impl Hash for Expr

§

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

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
§

impl InfectableNode for Expr

§

impl Into<Expr> for FunctionWrapper<Expr>

§

fn into(self) -> Expr

If a function has a function name, it may be called recursively. We use the named expression to hoist the function name internally Therefore, its recursive calls refer to the correct identity.

Else if a function has a binding name, it may be called recursively as well. But it refer the binding name which exist the outer scope. It is safe to using anonymous expression wrapper.

Optimization: A function without a name cannot be recursively referenced by Ident. It’s safe to return the expr without wrapper if the params.len is 0.

§

impl Node for Expr

§

fn emit_with<W, S>(&self, e: &mut Emitter<'_, W, S>) -> Result<(), Error>
where S: SourceMapper + SourceMapperExt, W: WriteJs,

§

impl PartialEq for Expr

§

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.
§

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

§

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

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

impl Serialize for Expr

§

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

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

impl Spanned for Expr

§

fn span(&self) -> Span

Get span of self.
§

fn span_lo(&self) -> BytePos

§

fn span_hi(&self) -> BytePos

§

impl StartsWithAlphaNum for Expr

§

impl Take for Expr

§

fn dummy() -> Expr

Create a dummy value of this type.
§

fn take(&mut self) -> Self

§

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

Mutate self using op, which accepts owned data.
§

impl<V> VisitMutWith<V> for Expr
where V: VisitMut + ?Sized,

§

fn visit_mut_with(&mut self, visitor: &mut V)

Calls VisitMut::visit_mut_expr with self.

§

fn visit_mut_children_with(&mut self, visitor: &mut V)

Visit children nodes of self`` with visitor`.
§

impl<V> VisitWith<V> for Expr
where V: Visit + ?Sized,

§

fn visit_with(&self, visitor: &mut V)

Calls Visit::visit_expr with self.

§

fn visit_children_with(&self, visitor: &mut V)

Visit children nodes of self`` with visitor`.
§

impl Eq for Expr

§

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
source§

impl<T, E> Emit<&T> for E
where E: Emit<T>, T: Spanned,

source§

fn emit(&mut self, node: &&T) -> Result<(), Error>

source§

impl<T, E> Emit<Box<T>> for E
where E: Emit<T>, T: Spanned,

source§

fn emit(&mut self, node: &Box<T>) -> Result<(), Error>

source§

impl<T, E> Emit<Option<T>> for E
where E: Emit<T>, T: Spanned,

source§

fn emit(&mut self, node: &Option<T>) -> Result<(), Error>

§

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

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

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

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
§

impl<T> ExprFactory for T
where T: Into<Box<Expr>>,

§

fn as_arg(self) -> ExprOrSpread

Creates an ExprOrSpread using the given Expr. Read more
§

fn into_stmt(self) -> Stmt

Creates an expression statement with self.
§

fn into_return_stmt(self) -> ReturnStmt

Creates a statement whcih return self.
§

fn as_callee(self) -> Callee

§

fn as_iife(self) -> CallExpr

§

fn into_lazy_arrow(self, params: Vec<Pat>) -> ArrowExpr

create a ArrowExpr which return self Read more
§

fn into_lazy_fn(self, params: Vec<Param>) -> Function

create a Function which return self Read more
§

fn into_lazy_auto(self, params: Vec<Pat>, support_arrow: bool) -> Expr

§

fn into_var_decl(self, kind: VarDeclKind, name: Pat) -> VarDecl

create a var declartor using self as init Read more
§

fn into_new_expr(self, span: Span, args: Option<Vec<ExprOrSpread>>) -> NewExpr

§

fn apply(self, span: Span, this: Box<Expr>, args: Vec<ExprOrSpread>) -> Expr

§

fn call_fn(self, span: Span, args: Vec<ExprOrSpread>) -> Expr

§

fn as_call(self, span: Span, args: Vec<ExprOrSpread>) -> Expr

§

fn as_fn_decl(self) -> Option<FnDecl>

§

fn as_class_decl(self) -> Option<ClassDecl>

§

fn wrap_with_paren(self) -> Expr

§

fn make_eq<T>(self, right: T) -> Expr
where T: Into<Expr>,

Creates a binary expr $self ===
§

fn make_bin<T>(self, op: BinaryOp, right: T) -> Expr
where T: Into<Expr>,

Creates a binary expr $self $op $rhs
§

fn make_assign_to(self, op: AssignOp, left: AssignTarget) -> Expr

Creates a assign expr $lhs $op $self
§

fn make_member(self, prop: IdentName) -> MemberExpr

§

fn computed_member<T>(self, prop: T) -> MemberExpr
where T: Into<Box<Expr>>,

§

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.

source§

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

source§

fn clone_quote_var(&self) -> Self

Available on crate feature ecma_quote only.
§

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<D> OwoColorize for D

§

fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>
where C: Color,

Set the foreground color generically Read more
§

fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>
where C: Color,

Set the background color generically. Read more
§

fn black(&self) -> FgColorDisplay<'_, Black, Self>

Change the foreground color to black
§

fn on_black(&self) -> BgColorDisplay<'_, Black, Self>

Change the background color to black
§

fn red(&self) -> FgColorDisplay<'_, Red, Self>

Change the foreground color to red
§

fn on_red(&self) -> BgColorDisplay<'_, Red, Self>

Change the background color to red
§

fn green(&self) -> FgColorDisplay<'_, Green, Self>

Change the foreground color to green
§

fn on_green(&self) -> BgColorDisplay<'_, Green, Self>

Change the background color to green
§

fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>

Change the foreground color to yellow
§

fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>

Change the background color to yellow
§

fn blue(&self) -> FgColorDisplay<'_, Blue, Self>

Change the foreground color to blue
§

fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>

Change the background color to blue
§

fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to magenta
§

fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to magenta
§

fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to purple
§

fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to purple
§

fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>

Change the foreground color to cyan
§

fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>

Change the background color to cyan
§

fn white(&self) -> FgColorDisplay<'_, White, Self>

Change the foreground color to white
§

fn on_white(&self) -> BgColorDisplay<'_, White, Self>

Change the background color to white
§

fn default_color(&self) -> FgColorDisplay<'_, Default, Self>

Change the foreground color to the terminal default
§

fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>

Change the background color to the terminal default
§

fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>

Change the foreground color to bright black
§

fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>

Change the background color to bright black
§

fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>

Change the foreground color to bright red
§

fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>

Change the background color to bright red
§

fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>

Change the foreground color to bright green
§

fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>

Change the background color to bright green
§

fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>

Change the foreground color to bright yellow
§

fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>

Change the background color to bright yellow
§

fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>

Change the foreground color to bright blue
§

fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>

Change the background color to bright blue
§

fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright magenta
§

fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright magenta
§

fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright purple
§

fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright purple
§

fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>

Change the foreground color to bright cyan
§

fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>

Change the background color to bright cyan
§

fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>

Change the foreground color to bright white
§

fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>

Change the background color to bright white
§

fn bold(&self) -> BoldDisplay<'_, Self>

Make the text bold
§

fn dimmed(&self) -> DimDisplay<'_, Self>

Make the text dim
§

fn italic(&self) -> ItalicDisplay<'_, Self>

Make the text italicized
§

fn underline(&self) -> UnderlineDisplay<'_, Self>

Make the text italicized
Make the text blink
Make the text blink (but fast!)
§

fn reversed(&self) -> ReversedDisplay<'_, Self>

Swap the foreground and background colors
§

fn hidden(&self) -> HiddenDisplay<'_, Self>

Hide the text
§

fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>

Cross out the text
§

fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the foreground color at runtime. Only use if you do not know which color will be used at compile-time. If the color is constant, use either OwoColorize::fg or a color-specific method, such as OwoColorize::green, Read more
§

fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the background color at runtime. Only use if you do not know what color to use at compile-time. If the color is constant, use either OwoColorize::bg or a color-specific method, such as OwoColorize::on_yellow, Read more
§

fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the foreground color to a specific RGB value.
§

fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the background color to a specific RGB value.
§

fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>

Sets the foreground color to an RGB value.
§

fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>

Sets the background color to an RGB value.
§

fn style(&self, style: Style) -> Styled<&Self>

Apply a runtime-determined style
§

impl<T, P> Parse<Box<T>> for P
where P: Parse<T>,

§

fn parse(&mut self) -> Result<Box<T>, Error>

§

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> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Pointee for T

§

type Metadata = ()

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

impl<T> Same for T

source§

type Output = T

Should always be 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.
§

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

§

fn is_synthesized(&self) -> bool

§

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

§

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>,