pub enum Expr {
Show 37 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, Global>),
JSXFragment(JSXFragment),
TsTypeAssertion(TsTypeAssertion),
TsConstAssertion(TsConstAssertion),
TsNonNull(TsNonNullExpr),
TsAs(TsAsExpr),
TsInstantiation(TsInstantiation),
PrivateName(PrivateName),
OptChain(OptChainExpr),
Invalid(Invalid),
}
visit
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, Global>)
JSXFragment(JSXFragment)
TsTypeAssertion(TsTypeAssertion)
TsConstAssertion(TsConstAssertion)
TsNonNull(TsNonNullExpr)
TsAs(TsAsExpr)
TsInstantiation(TsInstantiation)
PrivateName(PrivateName)
OptChain(OptChainExpr)
Invalid(Invalid)
Implementations
sourceimpl Expr
impl Expr
sourcepub fn is_this(&self) -> bool
Available on crate feature ast
only.
pub fn is_this(&self) -> bool
ast
only.Returns true
if self
is of variant This
.
sourcepub fn as_this(&self) -> Option<&ThisExpr>
Available on crate feature ast
only.
pub fn as_this(&self) -> Option<&ThisExpr>
ast
only.Returns Some
if self
is a reference of variant This
, and None
otherwise.
sourcepub fn as_mut_this(&mut self) -> Option<&mut ThisExpr>
Available on crate feature ast
only.
pub fn as_mut_this(&mut self) -> Option<&mut ThisExpr>
ast
only.Returns Some
if self
is a mutable reference of variant This
, and None
otherwise.
sourcepub fn expect_this(self) -> ThisExpr where
Expr: Debug,
Available on crate feature ast
only.
pub fn expect_this(self) -> ThisExpr where
Expr: Debug,
ast
only.sourcepub fn this(self) -> Option<ThisExpr>
Available on crate feature ast
only.
pub fn this(self) -> Option<ThisExpr>
ast
only.Returns Some
if self
is of variant This
, and None
otherwise.
sourcepub fn is_array(&self) -> bool
Available on crate feature ast
only.
pub fn is_array(&self) -> bool
ast
only.Returns true
if self
is of variant Array
.
sourcepub fn as_array(&self) -> Option<&ArrayLit>
Available on crate feature ast
only.
pub fn as_array(&self) -> Option<&ArrayLit>
ast
only.Returns Some
if self
is a reference of variant Array
, and None
otherwise.
sourcepub fn as_mut_array(&mut self) -> Option<&mut ArrayLit>
Available on crate feature ast
only.
pub fn as_mut_array(&mut self) -> Option<&mut ArrayLit>
ast
only.Returns Some
if self
is a mutable reference of variant Array
, and None
otherwise.
sourcepub fn expect_array(self) -> ArrayLit where
Expr: Debug,
Available on crate feature ast
only.
pub fn expect_array(self) -> ArrayLit where
Expr: Debug,
ast
only.sourcepub fn array(self) -> Option<ArrayLit>
Available on crate feature ast
only.
pub fn array(self) -> Option<ArrayLit>
ast
only.Returns Some
if self
is of variant Array
, and None
otherwise.
sourcepub fn is_object(&self) -> bool
Available on crate feature ast
only.
pub fn is_object(&self) -> bool
ast
only.Returns true
if self
is of variant Object
.
sourcepub fn as_object(&self) -> Option<&ObjectLit>
Available on crate feature ast
only.
pub fn as_object(&self) -> Option<&ObjectLit>
ast
only.Returns Some
if self
is a reference of variant Object
, and None
otherwise.
sourcepub fn as_mut_object(&mut self) -> Option<&mut ObjectLit>
Available on crate feature ast
only.
pub fn as_mut_object(&mut self) -> Option<&mut ObjectLit>
ast
only.Returns Some
if self
is a mutable reference of variant Object
, and None
otherwise.
sourcepub fn expect_object(self) -> ObjectLit where
Expr: Debug,
Available on crate feature ast
only.
pub fn expect_object(self) -> ObjectLit where
Expr: Debug,
ast
only.sourcepub fn object(self) -> Option<ObjectLit>
Available on crate feature ast
only.
pub fn object(self) -> Option<ObjectLit>
ast
only.Returns Some
if self
is of variant Object
, and None
otherwise.
sourcepub fn is_fn_expr(&self) -> bool
Available on crate feature ast
only.
pub fn is_fn_expr(&self) -> bool
ast
only.Returns true
if self
is of variant Fn
.
sourcepub fn as_fn_expr(&self) -> Option<&FnExpr>
Available on crate feature ast
only.
pub fn as_fn_expr(&self) -> Option<&FnExpr>
ast
only.Returns Some
if self
is a reference of variant Fn
, and None
otherwise.
sourcepub fn as_mut_fn_expr(&mut self) -> Option<&mut FnExpr>
Available on crate feature ast
only.
pub fn as_mut_fn_expr(&mut self) -> Option<&mut FnExpr>
ast
only.Returns Some
if self
is a mutable reference of variant Fn
, and None
otherwise.
sourcepub fn expect_fn_expr(self) -> FnExpr where
Expr: Debug,
Available on crate feature ast
only.
pub fn expect_fn_expr(self) -> FnExpr where
Expr: Debug,
ast
only.sourcepub fn fn_expr(self) -> Option<FnExpr>
Available on crate feature ast
only.
pub fn fn_expr(self) -> Option<FnExpr>
ast
only.Returns Some
if self
is of variant Fn
, and None
otherwise.
sourcepub fn is_unary(&self) -> bool
Available on crate feature ast
only.
pub fn is_unary(&self) -> bool
ast
only.Returns true
if self
is of variant Unary
.
sourcepub fn as_unary(&self) -> Option<&UnaryExpr>
Available on crate feature ast
only.
pub fn as_unary(&self) -> Option<&UnaryExpr>
ast
only.Returns Some
if self
is a reference of variant Unary
, and None
otherwise.
sourcepub fn as_mut_unary(&mut self) -> Option<&mut UnaryExpr>
Available on crate feature ast
only.
pub fn as_mut_unary(&mut self) -> Option<&mut UnaryExpr>
ast
only.Returns Some
if self
is a mutable reference of variant Unary
, and None
otherwise.
sourcepub fn expect_unary(self) -> UnaryExpr where
Expr: Debug,
Available on crate feature ast
only.
pub fn expect_unary(self) -> UnaryExpr where
Expr: Debug,
ast
only.sourcepub fn unary(self) -> Option<UnaryExpr>
Available on crate feature ast
only.
pub fn unary(self) -> Option<UnaryExpr>
ast
only.Returns Some
if self
is of variant Unary
, and None
otherwise.
sourcepub fn is_update(&self) -> bool
Available on crate feature ast
only.
pub fn is_update(&self) -> bool
ast
only.Returns true
if self
is of variant Update
.
sourcepub fn as_update(&self) -> Option<&UpdateExpr>
Available on crate feature ast
only.
pub fn as_update(&self) -> Option<&UpdateExpr>
ast
only.Returns Some
if self
is a reference of variant Update
, and None
otherwise.
sourcepub fn as_mut_update(&mut self) -> Option<&mut UpdateExpr>
Available on crate feature ast
only.
pub fn as_mut_update(&mut self) -> Option<&mut UpdateExpr>
ast
only.Returns Some
if self
is a mutable reference of variant Update
, and None
otherwise.
sourcepub fn expect_update(self) -> UpdateExpr where
Expr: Debug,
Available on crate feature ast
only.
pub fn expect_update(self) -> UpdateExpr where
Expr: Debug,
ast
only.sourcepub fn update(self) -> Option<UpdateExpr>
Available on crate feature ast
only.
pub fn update(self) -> Option<UpdateExpr>
ast
only.Returns Some
if self
is of variant Update
, and None
otherwise.
sourcepub fn is_bin(&self) -> bool
Available on crate feature ast
only.
pub fn is_bin(&self) -> bool
ast
only.Returns true
if self
is of variant Bin
.
sourcepub fn as_bin(&self) -> Option<&BinExpr>
Available on crate feature ast
only.
pub fn as_bin(&self) -> Option<&BinExpr>
ast
only.Returns Some
if self
is a reference of variant Bin
, and None
otherwise.
sourcepub fn as_mut_bin(&mut self) -> Option<&mut BinExpr>
Available on crate feature ast
only.
pub fn as_mut_bin(&mut self) -> Option<&mut BinExpr>
ast
only.Returns Some
if self
is a mutable reference of variant Bin
, and None
otherwise.
sourcepub fn expect_bin(self) -> BinExpr where
Expr: Debug,
Available on crate feature ast
only.
pub fn expect_bin(self) -> BinExpr where
Expr: Debug,
ast
only.sourcepub fn bin(self) -> Option<BinExpr>
Available on crate feature ast
only.
pub fn bin(self) -> Option<BinExpr>
ast
only.Returns Some
if self
is of variant Bin
, and None
otherwise.
sourcepub fn is_assign(&self) -> bool
Available on crate feature ast
only.
pub fn is_assign(&self) -> bool
ast
only.Returns true
if self
is of variant Assign
.
sourcepub fn as_assign(&self) -> Option<&AssignExpr>
Available on crate feature ast
only.
pub fn as_assign(&self) -> Option<&AssignExpr>
ast
only.Returns Some
if self
is a reference of variant Assign
, and None
otherwise.
sourcepub fn as_mut_assign(&mut self) -> Option<&mut AssignExpr>
Available on crate feature ast
only.
pub fn as_mut_assign(&mut self) -> Option<&mut AssignExpr>
ast
only.Returns Some
if self
is a mutable reference of variant Assign
, and None
otherwise.
sourcepub fn expect_assign(self) -> AssignExpr where
Expr: Debug,
Available on crate feature ast
only.
pub fn expect_assign(self) -> AssignExpr where
Expr: Debug,
ast
only.sourcepub fn assign(self) -> Option<AssignExpr>
Available on crate feature ast
only.
pub fn assign(self) -> Option<AssignExpr>
ast
only.Returns Some
if self
is of variant Assign
, and None
otherwise.
sourcepub fn is_member(&self) -> bool
Available on crate feature ast
only.
pub fn is_member(&self) -> bool
ast
only.Returns true
if self
is of variant Member
.
sourcepub fn as_member(&self) -> Option<&MemberExpr>
Available on crate feature ast
only.
pub fn as_member(&self) -> Option<&MemberExpr>
ast
only.Returns Some
if self
is a reference of variant Member
, and None
otherwise.
sourcepub fn as_mut_member(&mut self) -> Option<&mut MemberExpr>
Available on crate feature ast
only.
pub fn as_mut_member(&mut self) -> Option<&mut MemberExpr>
ast
only.Returns Some
if self
is a mutable reference of variant Member
, and None
otherwise.
sourcepub fn expect_member(self) -> MemberExpr where
Expr: Debug,
Available on crate feature ast
only.
pub fn expect_member(self) -> MemberExpr where
Expr: Debug,
ast
only.sourcepub fn member(self) -> Option<MemberExpr>
Available on crate feature ast
only.
pub fn member(self) -> Option<MemberExpr>
ast
only.Returns Some
if self
is of variant Member
, and None
otherwise.
sourcepub fn is_super_prop(&self) -> bool
Available on crate feature ast
only.
pub fn is_super_prop(&self) -> bool
ast
only.Returns true
if self
is of variant SuperProp
.
sourcepub fn as_super_prop(&self) -> Option<&SuperPropExpr>
Available on crate feature ast
only.
pub fn as_super_prop(&self) -> Option<&SuperPropExpr>
ast
only.Returns Some
if self
is a reference of variant SuperProp
, and None
otherwise.
sourcepub fn as_mut_super_prop(&mut self) -> Option<&mut SuperPropExpr>
Available on crate feature ast
only.
pub fn as_mut_super_prop(&mut self) -> Option<&mut SuperPropExpr>
ast
only.Returns Some
if self
is a mutable reference of variant SuperProp
, and None
otherwise.
sourcepub fn expect_super_prop(self) -> SuperPropExpr where
Expr: Debug,
Available on crate feature ast
only.
pub fn expect_super_prop(self) -> SuperPropExpr where
Expr: Debug,
ast
only.sourcepub fn super_prop(self) -> Option<SuperPropExpr>
Available on crate feature ast
only.
pub fn super_prop(self) -> Option<SuperPropExpr>
ast
only.Returns Some
if self
is of variant SuperProp
, and None
otherwise.
sourcepub fn is_cond(&self) -> bool
Available on crate feature ast
only.
pub fn is_cond(&self) -> bool
ast
only.Returns true
if self
is of variant Cond
.
sourcepub fn as_cond(&self) -> Option<&CondExpr>
Available on crate feature ast
only.
pub fn as_cond(&self) -> Option<&CondExpr>
ast
only.Returns Some
if self
is a reference of variant Cond
, and None
otherwise.
sourcepub fn as_mut_cond(&mut self) -> Option<&mut CondExpr>
Available on crate feature ast
only.
pub fn as_mut_cond(&mut self) -> Option<&mut CondExpr>
ast
only.Returns Some
if self
is a mutable reference of variant Cond
, and None
otherwise.
sourcepub fn expect_cond(self) -> CondExpr where
Expr: Debug,
Available on crate feature ast
only.
pub fn expect_cond(self) -> CondExpr where
Expr: Debug,
ast
only.sourcepub fn cond(self) -> Option<CondExpr>
Available on crate feature ast
only.
pub fn cond(self) -> Option<CondExpr>
ast
only.Returns Some
if self
is of variant Cond
, and None
otherwise.
sourcepub fn is_call(&self) -> bool
Available on crate feature ast
only.
pub fn is_call(&self) -> bool
ast
only.Returns true
if self
is of variant Call
.
sourcepub fn as_call(&self) -> Option<&CallExpr>
Available on crate feature ast
only.
pub fn as_call(&self) -> Option<&CallExpr>
ast
only.Returns Some
if self
is a reference of variant Call
, and None
otherwise.
sourcepub fn as_mut_call(&mut self) -> Option<&mut CallExpr>
Available on crate feature ast
only.
pub fn as_mut_call(&mut self) -> Option<&mut CallExpr>
ast
only.Returns Some
if self
is a mutable reference of variant Call
, and None
otherwise.
sourcepub fn expect_call(self) -> CallExpr where
Expr: Debug,
Available on crate feature ast
only.
pub fn expect_call(self) -> CallExpr where
Expr: Debug,
ast
only.sourcepub fn call(self) -> Option<CallExpr>
Available on crate feature ast
only.
pub fn call(self) -> Option<CallExpr>
ast
only.Returns Some
if self
is of variant Call
, and None
otherwise.
sourcepub fn is_new(&self) -> bool
Available on crate feature ast
only.
pub fn is_new(&self) -> bool
ast
only.Returns true
if self
is of variant New
.
sourcepub fn as_new(&self) -> Option<&NewExpr>
Available on crate feature ast
only.
pub fn as_new(&self) -> Option<&NewExpr>
ast
only.Returns Some
if self
is a reference of variant New
, and None
otherwise.
sourcepub fn as_mut_new(&mut self) -> Option<&mut NewExpr>
Available on crate feature ast
only.
pub fn as_mut_new(&mut self) -> Option<&mut NewExpr>
ast
only.Returns Some
if self
is a mutable reference of variant New
, and None
otherwise.
sourcepub fn expect_new(self) -> NewExpr where
Expr: Debug,
Available on crate feature ast
only.
pub fn expect_new(self) -> NewExpr where
Expr: Debug,
ast
only.sourcepub fn new(self) -> Option<NewExpr>
Available on crate feature ast
only.
pub fn new(self) -> Option<NewExpr>
ast
only.Returns Some
if self
is of variant New
, and None
otherwise.
sourcepub fn is_seq(&self) -> bool
Available on crate feature ast
only.
pub fn is_seq(&self) -> bool
ast
only.Returns true
if self
is of variant Seq
.
sourcepub fn as_seq(&self) -> Option<&SeqExpr>
Available on crate feature ast
only.
pub fn as_seq(&self) -> Option<&SeqExpr>
ast
only.Returns Some
if self
is a reference of variant Seq
, and None
otherwise.
sourcepub fn as_mut_seq(&mut self) -> Option<&mut SeqExpr>
Available on crate feature ast
only.
pub fn as_mut_seq(&mut self) -> Option<&mut SeqExpr>
ast
only.Returns Some
if self
is a mutable reference of variant Seq
, and None
otherwise.
sourcepub fn expect_seq(self) -> SeqExpr where
Expr: Debug,
Available on crate feature ast
only.
pub fn expect_seq(self) -> SeqExpr where
Expr: Debug,
ast
only.sourcepub fn seq(self) -> Option<SeqExpr>
Available on crate feature ast
only.
pub fn seq(self) -> Option<SeqExpr>
ast
only.Returns Some
if self
is of variant Seq
, and None
otherwise.
sourcepub fn is_ident(&self) -> bool
Available on crate feature ast
only.
pub fn is_ident(&self) -> bool
ast
only.Returns true
if self
is of variant Ident
.
sourcepub fn as_ident(&self) -> Option<&Ident>
Available on crate feature ast
only.
pub fn as_ident(&self) -> Option<&Ident>
ast
only.Returns Some
if self
is a reference of variant Ident
, and None
otherwise.
sourcepub fn as_mut_ident(&mut self) -> Option<&mut Ident>
Available on crate feature ast
only.
pub fn as_mut_ident(&mut self) -> Option<&mut Ident>
ast
only.Returns Some
if self
is a mutable reference of variant Ident
, and None
otherwise.
sourcepub fn expect_ident(self) -> Ident where
Expr: Debug,
Available on crate feature ast
only.
pub fn expect_ident(self) -> Ident where
Expr: Debug,
ast
only.sourcepub fn ident(self) -> Option<Ident>
Available on crate feature ast
only.
pub fn ident(self) -> Option<Ident>
ast
only.Returns Some
if self
is of variant Ident
, and None
otherwise.
sourcepub fn is_lit(&self) -> bool
Available on crate feature ast
only.
pub fn is_lit(&self) -> bool
ast
only.Returns true
if self
is of variant Lit
.
sourcepub fn as_lit(&self) -> Option<&Lit>
Available on crate feature ast
only.
pub fn as_lit(&self) -> Option<&Lit>
ast
only.Returns Some
if self
is a reference of variant Lit
, and None
otherwise.
sourcepub fn as_mut_lit(&mut self) -> Option<&mut Lit>
Available on crate feature ast
only.
pub fn as_mut_lit(&mut self) -> Option<&mut Lit>
ast
only.Returns Some
if self
is a mutable reference of variant Lit
, and None
otherwise.
sourcepub fn expect_lit(self) -> Lit where
Expr: Debug,
Available on crate feature ast
only.
pub fn expect_lit(self) -> Lit where
Expr: Debug,
ast
only.sourcepub fn lit(self) -> Option<Lit>
Available on crate feature ast
only.
pub fn lit(self) -> Option<Lit>
ast
only.Returns Some
if self
is of variant Lit
, and None
otherwise.
sourcepub fn is_tpl(&self) -> bool
Available on crate feature ast
only.
pub fn is_tpl(&self) -> bool
ast
only.Returns true
if self
is of variant Tpl
.
sourcepub fn as_tpl(&self) -> Option<&Tpl>
Available on crate feature ast
only.
pub fn as_tpl(&self) -> Option<&Tpl>
ast
only.Returns Some
if self
is a reference of variant Tpl
, and None
otherwise.
sourcepub fn as_mut_tpl(&mut self) -> Option<&mut Tpl>
Available on crate feature ast
only.
pub fn as_mut_tpl(&mut self) -> Option<&mut Tpl>
ast
only.Returns Some
if self
is a mutable reference of variant Tpl
, and None
otherwise.
sourcepub fn expect_tpl(self) -> Tpl where
Expr: Debug,
Available on crate feature ast
only.
pub fn expect_tpl(self) -> Tpl where
Expr: Debug,
ast
only.sourcepub fn tpl(self) -> Option<Tpl>
Available on crate feature ast
only.
pub fn tpl(self) -> Option<Tpl>
ast
only.Returns Some
if self
is of variant Tpl
, and None
otherwise.
sourcepub fn is_tagged_tpl(&self) -> bool
Available on crate feature ast
only.
pub fn is_tagged_tpl(&self) -> bool
ast
only.Returns true
if self
is of variant TaggedTpl
.
sourcepub fn as_tagged_tpl(&self) -> Option<&TaggedTpl>
Available on crate feature ast
only.
pub fn as_tagged_tpl(&self) -> Option<&TaggedTpl>
ast
only.Returns Some
if self
is a reference of variant TaggedTpl
, and None
otherwise.
sourcepub fn as_mut_tagged_tpl(&mut self) -> Option<&mut TaggedTpl>
Available on crate feature ast
only.
pub fn as_mut_tagged_tpl(&mut self) -> Option<&mut TaggedTpl>
ast
only.Returns Some
if self
is a mutable reference of variant TaggedTpl
, and None
otherwise.
sourcepub fn expect_tagged_tpl(self) -> TaggedTpl where
Expr: Debug,
Available on crate feature ast
only.
pub fn expect_tagged_tpl(self) -> TaggedTpl where
Expr: Debug,
ast
only.sourcepub fn tagged_tpl(self) -> Option<TaggedTpl>
Available on crate feature ast
only.
pub fn tagged_tpl(self) -> Option<TaggedTpl>
ast
only.Returns Some
if self
is of variant TaggedTpl
, and None
otherwise.
sourcepub fn is_arrow(&self) -> bool
Available on crate feature ast
only.
pub fn is_arrow(&self) -> bool
ast
only.Returns true
if self
is of variant Arrow
.
sourcepub fn as_arrow(&self) -> Option<&ArrowExpr>
Available on crate feature ast
only.
pub fn as_arrow(&self) -> Option<&ArrowExpr>
ast
only.Returns Some
if self
is a reference of variant Arrow
, and None
otherwise.
sourcepub fn as_mut_arrow(&mut self) -> Option<&mut ArrowExpr>
Available on crate feature ast
only.
pub fn as_mut_arrow(&mut self) -> Option<&mut ArrowExpr>
ast
only.Returns Some
if self
is a mutable reference of variant Arrow
, and None
otherwise.
sourcepub fn expect_arrow(self) -> ArrowExpr where
Expr: Debug,
Available on crate feature ast
only.
pub fn expect_arrow(self) -> ArrowExpr where
Expr: Debug,
ast
only.sourcepub fn arrow(self) -> Option<ArrowExpr>
Available on crate feature ast
only.
pub fn arrow(self) -> Option<ArrowExpr>
ast
only.Returns Some
if self
is of variant Arrow
, and None
otherwise.
sourcepub fn is_class(&self) -> bool
Available on crate feature ast
only.
pub fn is_class(&self) -> bool
ast
only.Returns true
if self
is of variant Class
.
sourcepub fn as_class(&self) -> Option<&ClassExpr>
Available on crate feature ast
only.
pub fn as_class(&self) -> Option<&ClassExpr>
ast
only.Returns Some
if self
is a reference of variant Class
, and None
otherwise.
sourcepub fn as_mut_class(&mut self) -> Option<&mut ClassExpr>
Available on crate feature ast
only.
pub fn as_mut_class(&mut self) -> Option<&mut ClassExpr>
ast
only.Returns Some
if self
is a mutable reference of variant Class
, and None
otherwise.
sourcepub fn expect_class(self) -> ClassExpr where
Expr: Debug,
Available on crate feature ast
only.
pub fn expect_class(self) -> ClassExpr where
Expr: Debug,
ast
only.sourcepub fn class(self) -> Option<ClassExpr>
Available on crate feature ast
only.
pub fn class(self) -> Option<ClassExpr>
ast
only.Returns Some
if self
is of variant Class
, and None
otherwise.
sourcepub fn is_yield_expr(&self) -> bool
Available on crate feature ast
only.
pub fn is_yield_expr(&self) -> bool
ast
only.Returns true
if self
is of variant Yield
.
sourcepub fn as_yield_expr(&self) -> Option<&YieldExpr>
Available on crate feature ast
only.
pub fn as_yield_expr(&self) -> Option<&YieldExpr>
ast
only.Returns Some
if self
is a reference of variant Yield
, and None
otherwise.
sourcepub fn as_mut_yield_expr(&mut self) -> Option<&mut YieldExpr>
Available on crate feature ast
only.
pub fn as_mut_yield_expr(&mut self) -> Option<&mut YieldExpr>
ast
only.Returns Some
if self
is a mutable reference of variant Yield
, and None
otherwise.
sourcepub fn expect_yield_expr(self) -> YieldExpr where
Expr: Debug,
Available on crate feature ast
only.
pub fn expect_yield_expr(self) -> YieldExpr where
Expr: Debug,
ast
only.sourcepub fn yield_expr(self) -> Option<YieldExpr>
Available on crate feature ast
only.
pub fn yield_expr(self) -> Option<YieldExpr>
ast
only.Returns Some
if self
is of variant Yield
, and None
otherwise.
sourcepub fn is_meta_prop(&self) -> bool
Available on crate feature ast
only.
pub fn is_meta_prop(&self) -> bool
ast
only.Returns true
if self
is of variant MetaProp
.
sourcepub fn as_meta_prop(&self) -> Option<&MetaPropExpr>
Available on crate feature ast
only.
pub fn as_meta_prop(&self) -> Option<&MetaPropExpr>
ast
only.Returns Some
if self
is a reference of variant MetaProp
, and None
otherwise.
sourcepub fn as_mut_meta_prop(&mut self) -> Option<&mut MetaPropExpr>
Available on crate feature ast
only.
pub fn as_mut_meta_prop(&mut self) -> Option<&mut MetaPropExpr>
ast
only.Returns Some
if self
is a mutable reference of variant MetaProp
, and None
otherwise.
sourcepub fn expect_meta_prop(self) -> MetaPropExpr where
Expr: Debug,
Available on crate feature ast
only.
pub fn expect_meta_prop(self) -> MetaPropExpr where
Expr: Debug,
ast
only.sourcepub fn meta_prop(self) -> Option<MetaPropExpr>
Available on crate feature ast
only.
pub fn meta_prop(self) -> Option<MetaPropExpr>
ast
only.Returns Some
if self
is of variant MetaProp
, and None
otherwise.
sourcepub fn is_await_expr(&self) -> bool
Available on crate feature ast
only.
pub fn is_await_expr(&self) -> bool
ast
only.Returns true
if self
is of variant Await
.
sourcepub fn as_await_expr(&self) -> Option<&AwaitExpr>
Available on crate feature ast
only.
pub fn as_await_expr(&self) -> Option<&AwaitExpr>
ast
only.Returns Some
if self
is a reference of variant Await
, and None
otherwise.
sourcepub fn as_mut_await_expr(&mut self) -> Option<&mut AwaitExpr>
Available on crate feature ast
only.
pub fn as_mut_await_expr(&mut self) -> Option<&mut AwaitExpr>
ast
only.Returns Some
if self
is a mutable reference of variant Await
, and None
otherwise.
sourcepub fn expect_await_expr(self) -> AwaitExpr where
Expr: Debug,
Available on crate feature ast
only.
pub fn expect_await_expr(self) -> AwaitExpr where
Expr: Debug,
ast
only.sourcepub fn await_expr(self) -> Option<AwaitExpr>
Available on crate feature ast
only.
pub fn await_expr(self) -> Option<AwaitExpr>
ast
only.Returns Some
if self
is of variant Await
, and None
otherwise.
sourcepub fn is_paren(&self) -> bool
Available on crate feature ast
only.
pub fn is_paren(&self) -> bool
ast
only.Returns true
if self
is of variant Paren
.
sourcepub fn as_paren(&self) -> Option<&ParenExpr>
Available on crate feature ast
only.
pub fn as_paren(&self) -> Option<&ParenExpr>
ast
only.Returns Some
if self
is a reference of variant Paren
, and None
otherwise.
sourcepub fn as_mut_paren(&mut self) -> Option<&mut ParenExpr>
Available on crate feature ast
only.
pub fn as_mut_paren(&mut self) -> Option<&mut ParenExpr>
ast
only.Returns Some
if self
is a mutable reference of variant Paren
, and None
otherwise.
sourcepub fn expect_paren(self) -> ParenExpr where
Expr: Debug,
Available on crate feature ast
only.
pub fn expect_paren(self) -> ParenExpr where
Expr: Debug,
ast
only.sourcepub fn paren(self) -> Option<ParenExpr>
Available on crate feature ast
only.
pub fn paren(self) -> Option<ParenExpr>
ast
only.Returns Some
if self
is of variant Paren
, and None
otherwise.
sourcepub fn is_jsx_member(&self) -> bool
Available on crate feature ast
only.
pub fn is_jsx_member(&self) -> bool
ast
only.Returns true
if self
is of variant JSXMember
.
sourcepub fn as_jsx_member(&self) -> Option<&JSXMemberExpr>
Available on crate feature ast
only.
pub fn as_jsx_member(&self) -> Option<&JSXMemberExpr>
ast
only.Returns Some
if self
is a reference of variant JSXMember
, and None
otherwise.
sourcepub fn as_mut_jsx_member(&mut self) -> Option<&mut JSXMemberExpr>
Available on crate feature ast
only.
pub fn as_mut_jsx_member(&mut self) -> Option<&mut JSXMemberExpr>
ast
only.Returns Some
if self
is a mutable reference of variant JSXMember
, and None
otherwise.
sourcepub fn expect_jsx_member(self) -> JSXMemberExpr where
Expr: Debug,
Available on crate feature ast
only.
pub fn expect_jsx_member(self) -> JSXMemberExpr where
Expr: Debug,
ast
only.sourcepub fn jsx_member(self) -> Option<JSXMemberExpr>
Available on crate feature ast
only.
pub fn jsx_member(self) -> Option<JSXMemberExpr>
ast
only.Returns Some
if self
is of variant JSXMember
, and None
otherwise.
sourcepub fn is_jsx_namespaced_name(&self) -> bool
Available on crate feature ast
only.
pub fn is_jsx_namespaced_name(&self) -> bool
ast
only.Returns true
if self
is of variant JSXNamespacedName
.
sourcepub fn as_jsx_namespaced_name(&self) -> Option<&JSXNamespacedName>
Available on crate feature ast
only.
pub fn as_jsx_namespaced_name(&self) -> Option<&JSXNamespacedName>
ast
only.Returns Some
if self
is a reference of variant JSXNamespacedName
, and None
otherwise.
sourcepub fn as_mut_jsx_namespaced_name(&mut self) -> Option<&mut JSXNamespacedName>
Available on crate feature ast
only.
pub fn as_mut_jsx_namespaced_name(&mut self) -> Option<&mut JSXNamespacedName>
ast
only.Returns Some
if self
is a mutable reference of variant JSXNamespacedName
, and None
otherwise.
sourcepub fn expect_jsx_namespaced_name(self) -> JSXNamespacedName where
Expr: Debug,
Available on crate feature ast
only.
pub fn expect_jsx_namespaced_name(self) -> JSXNamespacedName where
Expr: Debug,
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
.
sourcepub fn jsx_namespaced_name(self) -> Option<JSXNamespacedName>
Available on crate feature ast
only.
pub fn jsx_namespaced_name(self) -> Option<JSXNamespacedName>
ast
only.Returns Some
if self
is of variant JSXNamespacedName
, and None
otherwise.
sourcepub fn is_jsx_empty(&self) -> bool
Available on crate feature ast
only.
pub fn is_jsx_empty(&self) -> bool
ast
only.Returns true
if self
is of variant JSXEmpty
.
sourcepub fn as_jsx_empty(&self) -> Option<&JSXEmptyExpr>
Available on crate feature ast
only.
pub fn as_jsx_empty(&self) -> Option<&JSXEmptyExpr>
ast
only.Returns Some
if self
is a reference of variant JSXEmpty
, and None
otherwise.
sourcepub fn as_mut_jsx_empty(&mut self) -> Option<&mut JSXEmptyExpr>
Available on crate feature ast
only.
pub fn as_mut_jsx_empty(&mut self) -> Option<&mut JSXEmptyExpr>
ast
only.Returns Some
if self
is a mutable reference of variant JSXEmpty
, and None
otherwise.
sourcepub fn expect_jsx_empty(self) -> JSXEmptyExpr where
Expr: Debug,
Available on crate feature ast
only.
pub fn expect_jsx_empty(self) -> JSXEmptyExpr where
Expr: Debug,
ast
only.sourcepub fn jsx_empty(self) -> Option<JSXEmptyExpr>
Available on crate feature ast
only.
pub fn jsx_empty(self) -> Option<JSXEmptyExpr>
ast
only.Returns Some
if self
is of variant JSXEmpty
, and None
otherwise.
sourcepub fn is_jsx_element(&self) -> bool
Available on crate feature ast
only.
pub fn is_jsx_element(&self) -> bool
ast
only.Returns true
if self
is of variant JSXElement
.
sourcepub fn as_jsx_element(&self) -> Option<&Box<JSXElement, Global>>
Available on crate feature ast
only.
pub fn as_jsx_element(&self) -> Option<&Box<JSXElement, Global>>
ast
only.Returns Some
if self
is a reference of variant JSXElement
, and None
otherwise.
sourcepub fn as_mut_jsx_element(&mut self) -> Option<&mut Box<JSXElement, Global>>
Available on crate feature ast
only.
pub fn as_mut_jsx_element(&mut self) -> Option<&mut Box<JSXElement, Global>>
ast
only.Returns Some
if self
is a mutable reference of variant JSXElement
, and None
otherwise.
sourcepub fn expect_jsx_element(self) -> Box<JSXElement, Global> where
Expr: Debug,
Available on crate feature ast
only.
pub fn expect_jsx_element(self) -> Box<JSXElement, Global> where
Expr: Debug,
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
.
sourcepub fn jsx_element(self) -> Option<Box<JSXElement, Global>>
Available on crate feature ast
only.
pub fn jsx_element(self) -> Option<Box<JSXElement, Global>>
ast
only.Returns Some
if self
is of variant JSXElement
, and None
otherwise.
sourcepub fn is_jsx_fragment(&self) -> bool
Available on crate feature ast
only.
pub fn is_jsx_fragment(&self) -> bool
ast
only.Returns true
if self
is of variant JSXFragment
.
sourcepub fn as_jsx_fragment(&self) -> Option<&JSXFragment>
Available on crate feature ast
only.
pub fn as_jsx_fragment(&self) -> Option<&JSXFragment>
ast
only.Returns Some
if self
is a reference of variant JSXFragment
, and None
otherwise.
sourcepub fn as_mut_jsx_fragment(&mut self) -> Option<&mut JSXFragment>
Available on crate feature ast
only.
pub fn as_mut_jsx_fragment(&mut self) -> Option<&mut JSXFragment>
ast
only.Returns Some
if self
is a mutable reference of variant JSXFragment
, and None
otherwise.
sourcepub fn expect_jsx_fragment(self) -> JSXFragment where
Expr: Debug,
Available on crate feature ast
only.
pub fn expect_jsx_fragment(self) -> JSXFragment where
Expr: Debug,
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
.
sourcepub fn jsx_fragment(self) -> Option<JSXFragment>
Available on crate feature ast
only.
pub fn jsx_fragment(self) -> Option<JSXFragment>
ast
only.Returns Some
if self
is of variant JSXFragment
, and None
otherwise.
sourcepub fn is_ts_type_assertion(&self) -> bool
Available on crate feature ast
only.
pub fn is_ts_type_assertion(&self) -> bool
ast
only.Returns true
if self
is of variant TsTypeAssertion
.
sourcepub fn as_ts_type_assertion(&self) -> Option<&TsTypeAssertion>
Available on crate feature ast
only.
pub fn as_ts_type_assertion(&self) -> Option<&TsTypeAssertion>
ast
only.Returns Some
if self
is a reference of variant TsTypeAssertion
, and None
otherwise.
sourcepub fn as_mut_ts_type_assertion(&mut self) -> Option<&mut TsTypeAssertion>
Available on crate feature ast
only.
pub fn as_mut_ts_type_assertion(&mut self) -> Option<&mut TsTypeAssertion>
ast
only.Returns Some
if self
is a mutable reference of variant TsTypeAssertion
, and None
otherwise.
sourcepub fn expect_ts_type_assertion(self) -> TsTypeAssertion where
Expr: Debug,
Available on crate feature ast
only.
pub fn expect_ts_type_assertion(self) -> TsTypeAssertion where
Expr: Debug,
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
.
sourcepub fn ts_type_assertion(self) -> Option<TsTypeAssertion>
Available on crate feature ast
only.
pub fn ts_type_assertion(self) -> Option<TsTypeAssertion>
ast
only.Returns Some
if self
is of variant TsTypeAssertion
, and None
otherwise.
sourcepub fn is_ts_const_assertion(&self) -> bool
Available on crate feature ast
only.
pub fn is_ts_const_assertion(&self) -> bool
ast
only.Returns true
if self
is of variant TsConstAssertion
.
sourcepub fn as_ts_const_assertion(&self) -> Option<&TsConstAssertion>
Available on crate feature ast
only.
pub fn as_ts_const_assertion(&self) -> Option<&TsConstAssertion>
ast
only.Returns Some
if self
is a reference of variant TsConstAssertion
, and None
otherwise.
sourcepub fn as_mut_ts_const_assertion(&mut self) -> Option<&mut TsConstAssertion>
Available on crate feature ast
only.
pub fn as_mut_ts_const_assertion(&mut self) -> Option<&mut TsConstAssertion>
ast
only.Returns Some
if self
is a mutable reference of variant TsConstAssertion
, and None
otherwise.
sourcepub fn expect_ts_const_assertion(self) -> TsConstAssertion where
Expr: Debug,
Available on crate feature ast
only.
pub fn expect_ts_const_assertion(self) -> TsConstAssertion where
Expr: Debug,
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
.
sourcepub fn ts_const_assertion(self) -> Option<TsConstAssertion>
Available on crate feature ast
only.
pub fn ts_const_assertion(self) -> Option<TsConstAssertion>
ast
only.Returns Some
if self
is of variant TsConstAssertion
, and None
otherwise.
sourcepub fn is_ts_non_null(&self) -> bool
Available on crate feature ast
only.
pub fn is_ts_non_null(&self) -> bool
ast
only.Returns true
if self
is of variant TsNonNull
.
sourcepub fn as_ts_non_null(&self) -> Option<&TsNonNullExpr>
Available on crate feature ast
only.
pub fn as_ts_non_null(&self) -> Option<&TsNonNullExpr>
ast
only.Returns Some
if self
is a reference of variant TsNonNull
, and None
otherwise.
sourcepub fn as_mut_ts_non_null(&mut self) -> Option<&mut TsNonNullExpr>
Available on crate feature ast
only.
pub fn as_mut_ts_non_null(&mut self) -> Option<&mut TsNonNullExpr>
ast
only.Returns Some
if self
is a mutable reference of variant TsNonNull
, and None
otherwise.
sourcepub fn expect_ts_non_null(self) -> TsNonNullExpr where
Expr: Debug,
Available on crate feature ast
only.
pub fn expect_ts_non_null(self) -> TsNonNullExpr where
Expr: Debug,
ast
only.sourcepub fn ts_non_null(self) -> Option<TsNonNullExpr>
Available on crate feature ast
only.
pub fn ts_non_null(self) -> Option<TsNonNullExpr>
ast
only.Returns Some
if self
is of variant TsNonNull
, and None
otherwise.
sourcepub fn is_ts_as(&self) -> bool
Available on crate feature ast
only.
pub fn is_ts_as(&self) -> bool
ast
only.Returns true
if self
is of variant TsAs
.
sourcepub fn as_ts_as(&self) -> Option<&TsAsExpr>
Available on crate feature ast
only.
pub fn as_ts_as(&self) -> Option<&TsAsExpr>
ast
only.Returns Some
if self
is a reference of variant TsAs
, and None
otherwise.
sourcepub fn as_mut_ts_as(&mut self) -> Option<&mut TsAsExpr>
Available on crate feature ast
only.
pub fn as_mut_ts_as(&mut self) -> Option<&mut TsAsExpr>
ast
only.Returns Some
if self
is a mutable reference of variant TsAs
, and None
otherwise.
sourcepub fn expect_ts_as(self) -> TsAsExpr where
Expr: Debug,
Available on crate feature ast
only.
pub fn expect_ts_as(self) -> TsAsExpr where
Expr: Debug,
ast
only.sourcepub fn ts_as(self) -> Option<TsAsExpr>
Available on crate feature ast
only.
pub fn ts_as(self) -> Option<TsAsExpr>
ast
only.Returns Some
if self
is of variant TsAs
, and None
otherwise.
sourcepub fn is_ts_instantiation(&self) -> bool
Available on crate feature ast
only.
pub fn is_ts_instantiation(&self) -> bool
ast
only.Returns true
if self
is of variant TsInstantiation
.
sourcepub fn as_ts_instantiation(&self) -> Option<&TsInstantiation>
Available on crate feature ast
only.
pub fn as_ts_instantiation(&self) -> Option<&TsInstantiation>
ast
only.Returns Some
if self
is a reference of variant TsInstantiation
, and None
otherwise.
sourcepub fn as_mut_ts_instantiation(&mut self) -> Option<&mut TsInstantiation>
Available on crate feature ast
only.
pub fn as_mut_ts_instantiation(&mut self) -> Option<&mut TsInstantiation>
ast
only.Returns Some
if self
is a mutable reference of variant TsInstantiation
, and None
otherwise.
sourcepub fn expect_ts_instantiation(self) -> TsInstantiation where
Expr: Debug,
Available on crate feature ast
only.
pub fn expect_ts_instantiation(self) -> TsInstantiation where
Expr: Debug,
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
.
sourcepub fn ts_instantiation(self) -> Option<TsInstantiation>
Available on crate feature ast
only.
pub fn ts_instantiation(self) -> Option<TsInstantiation>
ast
only.Returns Some
if self
is of variant TsInstantiation
, and None
otherwise.
sourcepub fn is_private_name(&self) -> bool
Available on crate feature ast
only.
pub fn is_private_name(&self) -> bool
ast
only.Returns true
if self
is of variant PrivateName
.
sourcepub fn as_private_name(&self) -> Option<&PrivateName>
Available on crate feature ast
only.
pub fn as_private_name(&self) -> Option<&PrivateName>
ast
only.Returns Some
if self
is a reference of variant PrivateName
, and None
otherwise.
sourcepub fn as_mut_private_name(&mut self) -> Option<&mut PrivateName>
Available on crate feature ast
only.
pub fn as_mut_private_name(&mut self) -> Option<&mut PrivateName>
ast
only.Returns Some
if self
is a mutable reference of variant PrivateName
, and None
otherwise.
sourcepub fn expect_private_name(self) -> PrivateName where
Expr: Debug,
Available on crate feature ast
only.
pub fn expect_private_name(self) -> PrivateName where
Expr: Debug,
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
.
sourcepub fn private_name(self) -> Option<PrivateName>
Available on crate feature ast
only.
pub fn private_name(self) -> Option<PrivateName>
ast
only.Returns Some
if self
is of variant PrivateName
, and None
otherwise.
sourcepub fn is_opt_chain(&self) -> bool
Available on crate feature ast
only.
pub fn is_opt_chain(&self) -> bool
ast
only.Returns true
if self
is of variant OptChain
.
sourcepub fn as_opt_chain(&self) -> Option<&OptChainExpr>
Available on crate feature ast
only.
pub fn as_opt_chain(&self) -> Option<&OptChainExpr>
ast
only.Returns Some
if self
is a reference of variant OptChain
, and None
otherwise.
sourcepub fn as_mut_opt_chain(&mut self) -> Option<&mut OptChainExpr>
Available on crate feature ast
only.
pub fn as_mut_opt_chain(&mut self) -> Option<&mut OptChainExpr>
ast
only.Returns Some
if self
is a mutable reference of variant OptChain
, and None
otherwise.
sourcepub fn expect_opt_chain(self) -> OptChainExpr where
Expr: Debug,
Available on crate feature ast
only.
pub fn expect_opt_chain(self) -> OptChainExpr where
Expr: Debug,
ast
only.sourcepub fn opt_chain(self) -> Option<OptChainExpr>
Available on crate feature ast
only.
pub fn opt_chain(self) -> Option<OptChainExpr>
ast
only.Returns Some
if self
is of variant OptChain
, and None
otherwise.
sourcepub fn is_invalid(&self) -> bool
Available on crate feature ast
only.
pub fn is_invalid(&self) -> bool
ast
only.Returns true
if self
is of variant Invalid
.
sourcepub fn as_invalid(&self) -> Option<&Invalid>
Available on crate feature ast
only.
pub fn as_invalid(&self) -> Option<&Invalid>
ast
only.Returns Some
if self
is a reference of variant Invalid
, and None
otherwise.
sourcepub fn as_mut_invalid(&mut self) -> Option<&mut Invalid>
Available on crate feature ast
only.
pub fn as_mut_invalid(&mut self) -> Option<&mut Invalid>
ast
only.Returns Some
if self
is a mutable reference of variant Invalid
, and None
otherwise.
sourcepub fn expect_invalid(self) -> Invalid where
Expr: Debug,
Available on crate feature ast
only.
pub fn expect_invalid(self) -> Invalid where
Expr: Debug,
ast
only.sourceimpl Expr
impl Expr
sourcepub fn unwrap_parens(&self) -> &Expr
Available on crate feature ast
only.
pub fn unwrap_parens(&self) -> &Expr
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.
sourcepub fn unwrap_parens_mut(&mut self) -> &mut Expr
Available on crate feature ast
only.
pub fn unwrap_parens_mut(&mut self) -> &mut Expr
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.
Trait Implementations
sourceimpl Archive for Expr
impl Archive for Expr
sourceimpl<'de> Deserialize<'de> for Expr
impl<'de> Deserialize<'de> for Expr
sourcefn deserialize<__D>(
__deserializer: __D
) -> Result<Expr, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
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
sourceimpl<__D> Deserialize<Expr, __D> for <Expr as Archive>::Archived where
__D: Fallible + SharedDeserializeRegistry + ?Sized,
impl<__D> Deserialize<Expr, __D> for <Expr as Archive>::Archived where
__D: Fallible + SharedDeserializeRegistry + ?Sized,
sourcefn deserialize(
&self,
deserializer: &mut __D
) -> Result<Expr, <__D as Fallible>::Error>
fn deserialize(
&self,
deserializer: &mut __D
) -> Result<Expr, <__D as Fallible>::Error>
Deserializes using the given deserializer
impl EndsWithAlphaNum for Expr
impl EndsWithAlphaNum for Expr
fn ends_with_alpha_num(&self) -> bool
sourceimpl EqIgnoreSpan for Expr
impl EqIgnoreSpan for Expr
fn eq_ignore_span(&self, other: &Expr) -> bool
sourceimpl ExprExt for Box<Expr, Global>
impl ExprExt for Box<Expr, Global>
fn as_expr(&self) -> &Expr
sourcefn is_immutable_value(&self) -> bool
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_undefined(&self, ctx: &ExprCtx) -> bool
fn is_void(&self) -> bool
sourcefn is_global_ref_to(&self, ctx: &ExprCtx, id: &str) -> bool
fn is_global_ref_to(&self, ctx: &ExprCtx, id: &str) -> bool
Returns true
if id
references a global object.
sourcefn is_one_of_global_ref_to(&self, ctx: &ExprCtx, ids: &[&str]) -> bool
fn is_one_of_global_ref_to(&self, ctx: &ExprCtx, ids: &[&str]) -> bool
Returns true
if id
references a global object.
sourcefn as_pure_bool(&self, ctx: &ExprCtx) -> Value<bool>
fn as_pure_bool(&self, ctx: &ExprCtx) -> Value<bool>
Get bool value of self
if it does not have any side effects.
sourcefn cast_to_bool(&self, ctx: &ExprCtx) -> (Purity, Value<bool>)
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. Read more
fn cast_to_number(&self, ctx: &ExprCtx) -> (Purity, Value<f64>)
sourcefn as_pure_number(&self, ctx: &ExprCtx) -> Value<f64>
fn as_pure_number(&self, ctx: &ExprCtx) -> Value<f64>
Emulates javascript Number() cast function. Read more
sourcefn as_pure_string(&self, ctx: &ExprCtx) -> Value<Cow<'_, str>>
fn as_pure_string(&self, ctx: &ExprCtx) -> Value<Cow<'_, str>>
Returns Known only if it’s pure.
sourcefn get_type(&self) -> Value<Type>
fn get_type(&self) -> Value<Type>
Apply the supplied predicate against all possible result Nodes of the expression. Read more
fn is_pure_callee(&self, ctx: &ExprCtx) -> bool
fn may_have_side_effects(&self, ctx: &ExprCtx) -> bool
sourceimpl ExprExt for Expr
impl ExprExt for Expr
fn as_expr(&self) -> &Expr
sourcefn is_immutable_value(&self) -> bool
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_undefined(&self, ctx: &ExprCtx) -> bool
fn is_void(&self) -> bool
sourcefn is_global_ref_to(&self, ctx: &ExprCtx, id: &str) -> bool
fn is_global_ref_to(&self, ctx: &ExprCtx, id: &str) -> bool
Returns true
if id
references a global object.
sourcefn is_one_of_global_ref_to(&self, ctx: &ExprCtx, ids: &[&str]) -> bool
fn is_one_of_global_ref_to(&self, ctx: &ExprCtx, ids: &[&str]) -> bool
Returns true
if id
references a global object.
sourcefn as_pure_bool(&self, ctx: &ExprCtx) -> Value<bool>
fn as_pure_bool(&self, ctx: &ExprCtx) -> Value<bool>
Get bool value of self
if it does not have any side effects.
sourcefn cast_to_bool(&self, ctx: &ExprCtx) -> (Purity, Value<bool>)
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. Read more
fn cast_to_number(&self, ctx: &ExprCtx) -> (Purity, Value<f64>)
sourcefn as_pure_number(&self, ctx: &ExprCtx) -> Value<f64>
fn as_pure_number(&self, ctx: &ExprCtx) -> Value<f64>
Emulates javascript Number() cast function. Read more
sourcefn as_pure_string(&self, ctx: &ExprCtx) -> Value<Cow<'_, str>>
fn as_pure_string(&self, ctx: &ExprCtx) -> Value<Cow<'_, str>>
Returns Known only if it’s pure.
sourcefn get_type(&self) -> Value<Type>
fn get_type(&self) -> Value<Type>
Apply the supplied predicate against all possible result Nodes of the expression. Read more
fn is_pure_callee(&self, ctx: &ExprCtx) -> bool
fn may_have_side_effects(&self, ctx: &ExprCtx) -> bool
sourceimpl From<(Atom<JsWordStaticSet>, SyntaxContext)> for Box<Expr, Global>
impl From<(Atom<JsWordStaticSet>, SyntaxContext)> for Box<Expr, Global>
sourcefn from(src: (Atom<JsWordStaticSet>, SyntaxContext)) -> Box<Expr, Global>
fn from(src: (Atom<JsWordStaticSet>, SyntaxContext)) -> Box<Expr, Global>
Converts to this type from the input type.
sourceimpl From<(Atom<JsWordStaticSet>, SyntaxContext)> for Expr
impl From<(Atom<JsWordStaticSet>, SyntaxContext)> for Expr
sourcefn from(src: (Atom<JsWordStaticSet>, SyntaxContext)) -> Expr
fn from(src: (Atom<JsWordStaticSet>, SyntaxContext)) -> Expr
Converts to this type from the input type.
sourceimpl From<AssignExpr> for Expr
impl From<AssignExpr> for Expr
sourcefn from(v: AssignExpr) -> Expr
fn from(v: AssignExpr) -> Expr
Converts to this type from the input type.
sourceimpl From<Atom<JsWordStaticSet>> for Expr
impl From<Atom<JsWordStaticSet>> for Expr
sourcefn from(src: Atom<JsWordStaticSet>) -> Expr
fn from(src: Atom<JsWordStaticSet>) -> Expr
Converts to this type from the input type.
sourceimpl From<Expr> for ExprOrSpread
impl From<Expr> for ExprOrSpread
sourcefn from(e: Expr) -> ExprOrSpread
fn from(e: Expr) -> ExprOrSpread
Converts to this type from the input type.
sourceimpl From<JSXEmptyExpr> for Expr
impl From<JSXEmptyExpr> for Expr
sourcefn from(v: JSXEmptyExpr) -> Expr
fn from(v: JSXEmptyExpr) -> Expr
Converts to this type from the input type.
sourceimpl From<JSXFragment> for Expr
impl From<JSXFragment> for Expr
sourcefn from(v: JSXFragment) -> Expr
fn from(v: JSXFragment) -> Expr
Converts to this type from the input type.
sourceimpl From<JSXMemberExpr> for Expr
impl From<JSXMemberExpr> for Expr
sourcefn from(v: JSXMemberExpr) -> Expr
fn from(v: JSXMemberExpr) -> Expr
Converts to this type from the input type.
sourceimpl From<JSXNamespacedName> for Expr
impl From<JSXNamespacedName> for Expr
sourcefn from(v: JSXNamespacedName) -> Expr
fn from(v: JSXNamespacedName) -> Expr
Converts to this type from the input type.
sourceimpl From<MemberExpr> for Expr
impl From<MemberExpr> for Expr
sourcefn from(v: MemberExpr) -> Expr
fn from(v: MemberExpr) -> Expr
Converts to this type from the input type.
sourceimpl From<MetaPropExpr> for Expr
impl From<MetaPropExpr> for Expr
sourcefn from(v: MetaPropExpr) -> Expr
fn from(v: MetaPropExpr) -> Expr
Converts to this type from the input type.
sourceimpl From<OptChainBase> for Expr
impl From<OptChainBase> for Expr
sourcefn from(opt: OptChainBase) -> Expr
fn from(opt: OptChainBase) -> Expr
Converts to this type from the input type.
sourceimpl From<OptChainExpr> for Expr
impl From<OptChainExpr> for Expr
sourcefn from(v: OptChainExpr) -> Expr
fn from(v: OptChainExpr) -> Expr
Converts to this type from the input type.
sourceimpl From<PrivateName> for Expr
impl From<PrivateName> for Expr
sourcefn from(v: PrivateName) -> Expr
fn from(v: PrivateName) -> Expr
Converts to this type from the input type.
sourceimpl From<SuperPropExpr> for Expr
impl From<SuperPropExpr> for Expr
sourcefn from(v: SuperPropExpr) -> Expr
fn from(v: SuperPropExpr) -> Expr
Converts to this type from the input type.
sourceimpl From<TsConstAssertion> for Expr
impl From<TsConstAssertion> for Expr
sourcefn from(v: TsConstAssertion) -> Expr
fn from(v: TsConstAssertion) -> Expr
Converts to this type from the input type.
sourceimpl From<TsInstantiation> for Expr
impl From<TsInstantiation> for Expr
sourcefn from(v: TsInstantiation) -> Expr
fn from(v: TsInstantiation) -> Expr
Converts to this type from the input type.
sourceimpl From<TsNonNullExpr> for Expr
impl From<TsNonNullExpr> for Expr
sourcefn from(v: TsNonNullExpr) -> Expr
fn from(v: TsNonNullExpr) -> Expr
Converts to this type from the input type.
sourceimpl From<TsTypeAssertion> for Expr
impl From<TsTypeAssertion> for Expr
sourcefn from(v: TsTypeAssertion) -> Expr
fn from(v: TsTypeAssertion) -> Expr
Converts to this type from the input type.
sourceimpl From<UpdateExpr> for Expr
impl From<UpdateExpr> for Expr
sourcefn from(v: UpdateExpr) -> Expr
fn from(v: UpdateExpr) -> Expr
Converts to this type from the input type.
sourceimpl Into<Expr> for FunctionWrapper<Expr>
impl Into<Expr> for FunctionWrapper<Expr>
sourcefn into(self) -> 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
impl Node for Expr
fn emit_with<W, S>(&self, e: &mut Emitter<'_, W, S>) -> Result<(), Error> where
S: SourceMapper + SourceMapperExt,
W: WriteJs,
sourceimpl PartialEq<Expr> for Expr
impl PartialEq<Expr> for Expr
sourceimpl<__S> Serialize<__S> for Expr where
__S: Fallible + Serializer + ScratchSpace + SharedSerializeRegistry + ?Sized,
impl<__S> Serialize<__S> for Expr where
__S: Fallible + Serializer + ScratchSpace + SharedSerializeRegistry + ?Sized,
sourceimpl Serialize for Expr
impl Serialize for Expr
sourcefn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
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 StartsWithAlphaNum for Expr
impl StartsWithAlphaNum for Expr
fn starts_with_alpha_num(&self) -> bool
sourceimpl<V> VisitAllWith<V> for Expr where
V: VisitAll + ?Sized,
impl<V> VisitAllWith<V> for Expr where
V: VisitAll + ?Sized,
sourcefn visit_all_with(&self, v: &mut V)
fn visit_all_with(&self, v: &mut V)
Calls a visitor method (v.visit_xxx) with self.
sourcefn visit_all_children_with(&self, _visitor: &mut V)
fn visit_all_children_with(&self, _visitor: &mut V)
Visit children nodes of self with v
sourceimpl<V> VisitMutWith<V> for Expr where
V: VisitMut + ?Sized,
impl<V> VisitMutWith<V> for Expr where
V: VisitMut + ?Sized,
sourcefn visit_mut_with(&mut self, v: &mut V)
fn visit_mut_with(&mut self, v: &mut V)
Calls a visitor method (v.visit_mut_xxx) with self.
fn visit_mut_children_with(&mut self, _visitor: &mut V)
sourceimpl<V> VisitWith<V> for Expr where
V: Visit + ?Sized,
impl<V> VisitWith<V> for Expr where
V: Visit + ?Sized,
sourcefn visit_with(&self, v: &mut V)
fn visit_with(&self, v: &mut V)
Calls a visitor method (v.visit_xxx) with self.
sourcefn visit_children_with(&self, _visitor: &mut V)
fn visit_children_with(&self, _visitor: &mut V)
Visit children nodes of self with v
impl Eq for Expr
impl StructuralEq for Expr
impl StructuralPartialEq for Expr
Auto Trait Implementations
impl RefUnwindSafe for Expr
impl Send for Expr
impl Sync for Expr
impl Unpin for Expr
impl UnwindSafe for Expr
Blanket Implementations
impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
fn pointer_metadata(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
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,
impl<T> ArchiveUnsized for T where
T: Archive,
type Archived = <T as Archive>::Archived
type Archived = <T as Archive>::Archived
The archived counterpart of this type. Unlike Archive
, it may be unsized. Read more
type MetadataResolver = ()
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
)
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. 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,
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>
fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
sourceimpl<T> ExprFactory for T where
T: Into<Expr>,
impl<T> ExprFactory for T where
T: Into<Expr>,
sourcefn as_arg(self) -> ExprOrSpread
fn as_arg(self) -> ExprOrSpread
Creates an ExprOrSpread using the given Expr. Read more
fn as_pat_or_expr(self) -> PatOrExpr
sourcefn into_return_stmt(self) -> ReturnStmt
fn into_return_stmt(self) -> ReturnStmt
Creates a statement whcih return self
.
fn as_callee(self) -> Callee
fn as_iife(self) -> CallExpr
sourcefn into_lazy_arrow(self, params: Vec<Pat, Global>) -> ArrowExpr
fn into_lazy_arrow(self, params: Vec<Pat, Global>) -> ArrowExpr
create a ArrowExpr which return self Read more
sourcefn into_lazy_fn(self, params: Vec<Param, Global>) -> Function
fn into_lazy_fn(self, params: Vec<Param, Global>) -> Function
create a Function which return self Read more
fn into_lazy_auto(self, params: Vec<Pat, Global>, support_arrow: bool) -> Expr
sourcefn into_var_decl(self, kind: VarDeclKind, name: Pat) -> VarDecl
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, Global>>
) -> NewExpr
fn apply(
self,
span: Span,
this: Box<Expr, Global>,
args: Vec<ExprOrSpread, Global>
) -> Expr
fn call_fn(self, span: Span, args: Vec<ExprOrSpread, Global>) -> Expr
fn as_call(self, span: Span, args: Vec<ExprOrSpread, Global>) -> Expr
fn as_fn_decl(self) -> Option<FnDecl>
fn as_class_decl(self) -> Option<ClassDecl>
fn wrap_with_paren(self) -> Expr
sourcefn make_bin<T>(self, op: BinaryOp, right: T) -> Expr where
T: Into<Expr>,
fn make_bin<T>(self, op: BinaryOp, right: T) -> Expr where
T: Into<Expr>,
Creates a binary expr $self $op $rhs
sourcefn make_assign_to(self, op: AssignOp, left: PatOrExpr) -> Expr
fn make_assign_to(self, op: AssignOp, left: PatOrExpr) -> Expr
Creates a assign expr $lhs $op $self
fn make_member<T>(self, prop: T) -> Expr where
T: Into<Ident>,
fn computed_member<T>(self, prop: T) -> Expr where
T: Into<Expr>,
sourceimpl<T> ImplicitClone for T where
T: Clone,
impl<T> ImplicitClone for T where
T: Clone,
sourcefn clone_quote_var(&self) -> Self
fn clone_quote_var(&self) -> Self
quote
only.sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<D> OwoColorize for D
impl<D> OwoColorize for D
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self> where
C: Color,
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,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self> where
C: Color,
Set the background color generically. Read more
fn black(&'a self) -> FgColorDisplay<'a, Black, Self>
fn black(&'a self) -> FgColorDisplay<'a, Black, Self>
Change the foreground color to black
fn on_black(&'a self) -> BgColorDisplay<'a, Black, Self>
fn on_black(&'a self) -> BgColorDisplay<'a, Black, Self>
Change the background color to black
fn red(&'a self) -> FgColorDisplay<'a, Red, Self>
fn red(&'a self) -> FgColorDisplay<'a, Red, Self>
Change the foreground color to red
fn on_red(&'a self) -> BgColorDisplay<'a, Red, Self>
fn on_red(&'a self) -> BgColorDisplay<'a, Red, Self>
Change the background color to red
fn green(&'a self) -> FgColorDisplay<'a, Green, Self>
fn green(&'a self) -> FgColorDisplay<'a, Green, Self>
Change the foreground color to green
fn on_green(&'a self) -> BgColorDisplay<'a, Green, Self>
fn on_green(&'a self) -> BgColorDisplay<'a, Green, Self>
Change the background color to green
fn yellow(&'a self) -> FgColorDisplay<'a, Yellow, Self>
fn yellow(&'a self) -> FgColorDisplay<'a, Yellow, Self>
Change the foreground color to yellow
fn on_yellow(&'a self) -> BgColorDisplay<'a, Yellow, Self>
fn on_yellow(&'a self) -> BgColorDisplay<'a, Yellow, Self>
Change the background color to yellow
fn blue(&'a self) -> FgColorDisplay<'a, Blue, Self>
fn blue(&'a self) -> FgColorDisplay<'a, Blue, Self>
Change the foreground color to blue
fn on_blue(&'a self) -> BgColorDisplay<'a, Blue, Self>
fn on_blue(&'a self) -> BgColorDisplay<'a, Blue, Self>
Change the background color to blue
fn magenta(&'a self) -> FgColorDisplay<'a, Magenta, Self>
fn magenta(&'a self) -> FgColorDisplay<'a, Magenta, Self>
Change the foreground color to magenta
fn on_magenta(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_magenta(&'a self) -> BgColorDisplay<'a, Magenta, Self>
Change the background color to magenta
fn purple(&'a self) -> FgColorDisplay<'a, Magenta, Self>
fn purple(&'a self) -> FgColorDisplay<'a, Magenta, Self>
Change the foreground color to purple
fn on_purple(&'a self) -> BgColorDisplay<'a, Magenta, Self>
fn on_purple(&'a self) -> BgColorDisplay<'a, Magenta, Self>
Change the background color to purple
fn cyan(&'a self) -> FgColorDisplay<'a, Cyan, Self>
fn cyan(&'a self) -> FgColorDisplay<'a, Cyan, Self>
Change the foreground color to cyan
fn on_cyan(&'a self) -> BgColorDisplay<'a, Cyan, Self>
fn on_cyan(&'a self) -> BgColorDisplay<'a, Cyan, Self>
Change the background color to cyan
fn white(&'a self) -> FgColorDisplay<'a, White, Self>
fn white(&'a self) -> FgColorDisplay<'a, White, Self>
Change the foreground color to white
fn on_white(&'a self) -> BgColorDisplay<'a, White, Self>
fn on_white(&'a self) -> BgColorDisplay<'a, White, Self>
Change the background color to white
fn default_color(&'a self) -> FgColorDisplay<'a, Default, Self>
fn default_color(&'a self) -> FgColorDisplay<'a, Default, Self>
Change the foreground color to the terminal default
fn on_default_color(&'a self) -> BgColorDisplay<'a, Default, Self>
fn on_default_color(&'a self) -> BgColorDisplay<'a, Default, Self>
Change the background color to the terminal default
fn bright_black(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
fn bright_black(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>
Change the foreground color to bright black
fn on_bright_black(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
fn on_bright_black(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>
Change the background color to bright black
fn bright_red(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
fn bright_red(&'a self) -> FgColorDisplay<'a, BrightRed, Self>
Change the foreground color to bright red
fn on_bright_red(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
fn on_bright_red(&'a self) -> BgColorDisplay<'a, BrightRed, Self>
Change the background color to bright red
fn bright_green(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
fn bright_green(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>
Change the foreground color to bright green
fn on_bright_green(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
fn on_bright_green(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>
Change the background color to bright green
fn bright_yellow(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
fn bright_yellow(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>
Change the foreground color to bright yellow
fn on_bright_yellow(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
fn on_bright_yellow(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>
Change the background color to bright yellow
fn bright_blue(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
fn bright_blue(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>
Change the foreground color to bright blue
fn on_bright_blue(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
fn on_bright_blue(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>
Change the background color to bright blue
fn bright_magenta(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_magenta(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
Change the foreground color to bright magenta
fn on_bright_magenta(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_magenta(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
Change the background color to bright magenta
fn bright_purple(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
fn bright_purple(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>
Change the foreground color to bright purple
fn on_bright_purple(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
fn on_bright_purple(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>
Change the background color to bright purple
fn bright_cyan(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
fn bright_cyan(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>
Change the foreground color to bright cyan
fn on_bright_cyan(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
fn on_bright_cyan(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>
Change the background color to bright cyan
fn bright_white(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
fn bright_white(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>
Change the foreground color to bright white
fn on_bright_white(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
fn on_bright_white(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>
Change the background color to bright white
fn bold(&'a self) -> BoldDisplay<'a, Self>
fn bold(&'a self) -> BoldDisplay<'a, Self>
Make the text bold
fn dimmed(&'a self) -> DimDisplay<'a, Self>
fn dimmed(&'a self) -> DimDisplay<'a, Self>
Make the text dim
fn italic(&'a self) -> ItalicDisplay<'a, Self>
fn italic(&'a self) -> ItalicDisplay<'a, Self>
Make the text italicized
fn underline(&'a self) -> UnderlineDisplay<'a, Self>
fn underline(&'a self) -> UnderlineDisplay<'a, Self>
Make the text italicized
fn blink(&'a self) -> BlinkDisplay<'a, Self>
fn blink(&'a self) -> BlinkDisplay<'a, Self>
Make the text blink
fn blink_fast(&'a self) -> BlinkFastDisplay<'a, Self>
fn blink_fast(&'a self) -> BlinkFastDisplay<'a, Self>
Make the text blink (but fast!)
fn reversed(&'a self) -> ReversedDisplay<'a, Self>
fn reversed(&'a self) -> ReversedDisplay<'a, Self>
Swap the foreground and background colors
Hide the text
fn strikethrough(&'a self) -> StrikeThroughDisplay<'a, Self>
fn strikethrough(&'a self) -> StrikeThroughDisplay<'a, Self>
Cross out the text
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self> where
Color: DynColor,
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,
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>
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>
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>
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>
fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>
Sets the background color to an RGB value.
impl<T> Pointable for T
impl<T> Pointable for T
impl<T, S> SerializeUnsized<S> for T where
T: Serialize<S>,
S: Serializer + ?Sized,
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>
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>
fn serialize_metadata(&self, &mut S) -> Result<(), <S as Fallible>::Error>
Serializes the metadata for the given type.
sourceimpl<T> SpanExt for T where
T: Spanned,
impl<T> SpanExt for T where
T: Spanned,
fn is_synthesized(&self) -> bool
fn starts_on_new_line(&self, format: ListFormat) -> bool
sourcefn comment_range(&self) -> Span
fn comment_range(&self) -> Span
Gets a custom text range to use when emitting comments.
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
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
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more