Enum swc_plugin::ast::swc_ecma_ast::Expr
[−]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),
}
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
impl Expr
impl Expr
pub fn as_this(&self) -> Option<&ThisExpr>
pub fn as_this(&self) -> Option<&ThisExpr>
Returns Some
if self
is a reference of variant This
, and None
otherwise.
pub fn as_mut_this(&mut self) -> Option<&mut ThisExpr>
pub fn as_mut_this(&mut self) -> Option<&mut ThisExpr>
Returns Some
if self
is a mutable reference of variant This
, and None
otherwise.
pub fn expect_this(self) -> ThisExpr where
Expr: Debug,
pub fn expect_this(self) -> ThisExpr where
Expr: Debug,
pub fn as_array(&self) -> Option<&ArrayLit>
pub fn as_array(&self) -> Option<&ArrayLit>
Returns Some
if self
is a reference of variant Array
, and None
otherwise.
pub fn as_mut_array(&mut self) -> Option<&mut ArrayLit>
pub fn as_mut_array(&mut self) -> Option<&mut ArrayLit>
Returns Some
if self
is a mutable reference of variant Array
, and None
otherwise.
pub fn expect_array(self) -> ArrayLit where
Expr: Debug,
pub fn expect_array(self) -> ArrayLit where
Expr: Debug,
pub fn as_object(&self) -> Option<&ObjectLit>
pub fn as_object(&self) -> Option<&ObjectLit>
Returns Some
if self
is a reference of variant Object
, and None
otherwise.
pub fn as_mut_object(&mut self) -> Option<&mut ObjectLit>
pub fn as_mut_object(&mut self) -> Option<&mut ObjectLit>
Returns Some
if self
is a mutable reference of variant Object
, and None
otherwise.
pub fn expect_object(self) -> ObjectLit where
Expr: Debug,
pub fn expect_object(self) -> ObjectLit where
Expr: Debug,
pub fn object(self) -> Option<ObjectLit>
pub fn object(self) -> Option<ObjectLit>
Returns Some
if self
is of variant Object
, and None
otherwise.
pub fn is_fn_expr(&self) -> bool
pub fn is_fn_expr(&self) -> bool
Returns true
if self
is of variant Fn
.
pub fn as_fn_expr(&self) -> Option<&FnExpr>
pub fn as_fn_expr(&self) -> Option<&FnExpr>
Returns Some
if self
is a reference of variant Fn
, and None
otherwise.
pub fn as_mut_fn_expr(&mut self) -> Option<&mut FnExpr>
pub fn as_mut_fn_expr(&mut self) -> Option<&mut FnExpr>
Returns Some
if self
is a mutable reference of variant Fn
, and None
otherwise.
pub fn expect_fn_expr(self) -> FnExpr where
Expr: Debug,
pub fn expect_fn_expr(self) -> FnExpr where
Expr: Debug,
pub fn as_unary(&self) -> Option<&UnaryExpr>
pub fn as_unary(&self) -> Option<&UnaryExpr>
Returns Some
if self
is a reference of variant Unary
, and None
otherwise.
pub fn as_mut_unary(&mut self) -> Option<&mut UnaryExpr>
pub fn as_mut_unary(&mut self) -> Option<&mut UnaryExpr>
Returns Some
if self
is a mutable reference of variant Unary
, and None
otherwise.
pub fn expect_unary(self) -> UnaryExpr where
Expr: Debug,
pub fn expect_unary(self) -> UnaryExpr where
Expr: Debug,
pub fn unary(self) -> Option<UnaryExpr>
pub fn unary(self) -> Option<UnaryExpr>
Returns Some
if self
is of variant Unary
, and None
otherwise.
pub fn as_update(&self) -> Option<&UpdateExpr>
pub fn as_update(&self) -> Option<&UpdateExpr>
Returns Some
if self
is a reference of variant Update
, and None
otherwise.
pub fn as_mut_update(&mut self) -> Option<&mut UpdateExpr>
pub fn as_mut_update(&mut self) -> Option<&mut UpdateExpr>
Returns Some
if self
is a mutable reference of variant Update
, and None
otherwise.
pub fn expect_update(self) -> UpdateExpr where
Expr: Debug,
pub fn expect_update(self) -> UpdateExpr where
Expr: Debug,
pub fn update(self) -> Option<UpdateExpr>
pub fn update(self) -> Option<UpdateExpr>
Returns Some
if self
is of variant Update
, and None
otherwise.
pub fn as_bin(&self) -> Option<&BinExpr>
pub fn as_bin(&self) -> Option<&BinExpr>
Returns Some
if self
is a reference of variant Bin
, and None
otherwise.
pub fn as_mut_bin(&mut self) -> Option<&mut BinExpr>
pub fn as_mut_bin(&mut self) -> Option<&mut BinExpr>
Returns Some
if self
is a mutable reference of variant Bin
, and None
otherwise.
pub fn expect_bin(self) -> BinExpr where
Expr: Debug,
pub fn expect_bin(self) -> BinExpr where
Expr: Debug,
pub fn as_assign(&self) -> Option<&AssignExpr>
pub fn as_assign(&self) -> Option<&AssignExpr>
Returns Some
if self
is a reference of variant Assign
, and None
otherwise.
pub fn as_mut_assign(&mut self) -> Option<&mut AssignExpr>
pub fn as_mut_assign(&mut self) -> Option<&mut AssignExpr>
Returns Some
if self
is a mutable reference of variant Assign
, and None
otherwise.
pub fn expect_assign(self) -> AssignExpr where
Expr: Debug,
pub fn expect_assign(self) -> AssignExpr where
Expr: Debug,
pub fn assign(self) -> Option<AssignExpr>
pub fn assign(self) -> Option<AssignExpr>
Returns Some
if self
is of variant Assign
, and None
otherwise.
pub fn as_member(&self) -> Option<&MemberExpr>
pub fn as_member(&self) -> Option<&MemberExpr>
Returns Some
if self
is a reference of variant Member
, and None
otherwise.
pub fn as_mut_member(&mut self) -> Option<&mut MemberExpr>
pub fn as_mut_member(&mut self) -> Option<&mut MemberExpr>
Returns Some
if self
is a mutable reference of variant Member
, and None
otherwise.
pub fn expect_member(self) -> MemberExpr where
Expr: Debug,
pub fn expect_member(self) -> MemberExpr where
Expr: Debug,
pub fn member(self) -> Option<MemberExpr>
pub fn member(self) -> Option<MemberExpr>
Returns Some
if self
is of variant Member
, and None
otherwise.
pub fn is_super_prop(&self) -> bool
pub fn is_super_prop(&self) -> bool
Returns true
if self
is of variant SuperProp
.
pub fn as_super_prop(&self) -> Option<&SuperPropExpr>
pub fn as_super_prop(&self) -> Option<&SuperPropExpr>
Returns Some
if self
is a reference of variant SuperProp
, and None
otherwise.
pub fn as_mut_super_prop(&mut self) -> Option<&mut SuperPropExpr>
pub fn as_mut_super_prop(&mut self) -> Option<&mut SuperPropExpr>
Returns Some
if self
is a mutable reference of variant SuperProp
, and None
otherwise.
pub fn expect_super_prop(self) -> SuperPropExpr where
Expr: Debug,
pub fn expect_super_prop(self) -> SuperPropExpr where
Expr: Debug,
pub fn super_prop(self) -> Option<SuperPropExpr>
pub fn super_prop(self) -> Option<SuperPropExpr>
Returns Some
if self
is of variant SuperProp
, and None
otherwise.
pub fn as_cond(&self) -> Option<&CondExpr>
pub fn as_cond(&self) -> Option<&CondExpr>
Returns Some
if self
is a reference of variant Cond
, and None
otherwise.
pub fn as_mut_cond(&mut self) -> Option<&mut CondExpr>
pub fn as_mut_cond(&mut self) -> Option<&mut CondExpr>
Returns Some
if self
is a mutable reference of variant Cond
, and None
otherwise.
pub fn expect_cond(self) -> CondExpr where
Expr: Debug,
pub fn expect_cond(self) -> CondExpr where
Expr: Debug,
pub fn as_call(&self) -> Option<&CallExpr>
pub fn as_call(&self) -> Option<&CallExpr>
Returns Some
if self
is a reference of variant Call
, and None
otherwise.
pub fn as_mut_call(&mut self) -> Option<&mut CallExpr>
pub fn as_mut_call(&mut self) -> Option<&mut CallExpr>
Returns Some
if self
is a mutable reference of variant Call
, and None
otherwise.
pub fn expect_call(self) -> CallExpr where
Expr: Debug,
pub fn expect_call(self) -> CallExpr where
Expr: Debug,
pub fn as_new(&self) -> Option<&NewExpr>
pub fn as_new(&self) -> Option<&NewExpr>
Returns Some
if self
is a reference of variant New
, and None
otherwise.
pub fn as_mut_new(&mut self) -> Option<&mut NewExpr>
pub fn as_mut_new(&mut self) -> Option<&mut NewExpr>
Returns Some
if self
is a mutable reference of variant New
, and None
otherwise.
pub fn expect_new(self) -> NewExpr where
Expr: Debug,
pub fn expect_new(self) -> NewExpr where
Expr: Debug,
pub fn as_seq(&self) -> Option<&SeqExpr>
pub fn as_seq(&self) -> Option<&SeqExpr>
Returns Some
if self
is a reference of variant Seq
, and None
otherwise.
pub fn as_mut_seq(&mut self) -> Option<&mut SeqExpr>
pub fn as_mut_seq(&mut self) -> Option<&mut SeqExpr>
Returns Some
if self
is a mutable reference of variant Seq
, and None
otherwise.
pub fn expect_seq(self) -> SeqExpr where
Expr: Debug,
pub fn expect_seq(self) -> SeqExpr where
Expr: Debug,
pub fn as_ident(&self) -> Option<&Ident>
pub fn as_ident(&self) -> Option<&Ident>
Returns Some
if self
is a reference of variant Ident
, and None
otherwise.
pub fn as_mut_ident(&mut self) -> Option<&mut Ident>
pub fn as_mut_ident(&mut self) -> Option<&mut Ident>
Returns Some
if self
is a mutable reference of variant Ident
, and None
otherwise.
pub fn expect_ident(self) -> Ident where
Expr: Debug,
pub fn expect_ident(self) -> Ident where
Expr: Debug,
pub fn as_lit(&self) -> Option<&Lit>
pub fn as_lit(&self) -> Option<&Lit>
Returns Some
if self
is a reference of variant Lit
, and None
otherwise.
pub fn as_mut_lit(&mut self) -> Option<&mut Lit>
pub fn as_mut_lit(&mut self) -> Option<&mut Lit>
Returns Some
if self
is a mutable reference of variant Lit
, and None
otherwise.
pub fn expect_lit(self) -> Lit where
Expr: Debug,
pub fn expect_lit(self) -> Lit where
Expr: Debug,
pub fn as_tpl(&self) -> Option<&Tpl>
pub fn as_tpl(&self) -> Option<&Tpl>
Returns Some
if self
is a reference of variant Tpl
, and None
otherwise.
pub fn as_mut_tpl(&mut self) -> Option<&mut Tpl>
pub fn as_mut_tpl(&mut self) -> Option<&mut Tpl>
Returns Some
if self
is a mutable reference of variant Tpl
, and None
otherwise.
pub fn expect_tpl(self) -> Tpl where
Expr: Debug,
pub fn expect_tpl(self) -> Tpl where
Expr: Debug,
pub fn is_tagged_tpl(&self) -> bool
pub fn is_tagged_tpl(&self) -> bool
Returns true
if self
is of variant TaggedTpl
.
pub fn as_tagged_tpl(&self) -> Option<&TaggedTpl>
pub fn as_tagged_tpl(&self) -> Option<&TaggedTpl>
Returns Some
if self
is a reference of variant TaggedTpl
, and None
otherwise.
pub fn as_mut_tagged_tpl(&mut self) -> Option<&mut TaggedTpl>
pub fn as_mut_tagged_tpl(&mut self) -> Option<&mut TaggedTpl>
Returns Some
if self
is a mutable reference of variant TaggedTpl
, and None
otherwise.
pub fn expect_tagged_tpl(self) -> TaggedTpl where
Expr: Debug,
pub fn expect_tagged_tpl(self) -> TaggedTpl where
Expr: Debug,
pub fn tagged_tpl(self) -> Option<TaggedTpl>
pub fn tagged_tpl(self) -> Option<TaggedTpl>
Returns Some
if self
is of variant TaggedTpl
, and None
otherwise.
pub fn as_arrow(&self) -> Option<&ArrowExpr>
pub fn as_arrow(&self) -> Option<&ArrowExpr>
Returns Some
if self
is a reference of variant Arrow
, and None
otherwise.
pub fn as_mut_arrow(&mut self) -> Option<&mut ArrowExpr>
pub fn as_mut_arrow(&mut self) -> Option<&mut ArrowExpr>
Returns Some
if self
is a mutable reference of variant Arrow
, and None
otherwise.
pub fn expect_arrow(self) -> ArrowExpr where
Expr: Debug,
pub fn expect_arrow(self) -> ArrowExpr where
Expr: Debug,
pub fn arrow(self) -> Option<ArrowExpr>
pub fn arrow(self) -> Option<ArrowExpr>
Returns Some
if self
is of variant Arrow
, and None
otherwise.
pub fn as_class(&self) -> Option<&ClassExpr>
pub fn as_class(&self) -> Option<&ClassExpr>
Returns Some
if self
is a reference of variant Class
, and None
otherwise.
pub fn as_mut_class(&mut self) -> Option<&mut ClassExpr>
pub fn as_mut_class(&mut self) -> Option<&mut ClassExpr>
Returns Some
if self
is a mutable reference of variant Class
, and None
otherwise.
pub fn expect_class(self) -> ClassExpr where
Expr: Debug,
pub fn expect_class(self) -> ClassExpr where
Expr: Debug,
pub fn class(self) -> Option<ClassExpr>
pub fn class(self) -> Option<ClassExpr>
Returns Some
if self
is of variant Class
, and None
otherwise.
pub fn is_yield_expr(&self) -> bool
pub fn is_yield_expr(&self) -> bool
Returns true
if self
is of variant Yield
.
pub fn as_yield_expr(&self) -> Option<&YieldExpr>
pub fn as_yield_expr(&self) -> Option<&YieldExpr>
Returns Some
if self
is a reference of variant Yield
, and None
otherwise.
pub fn as_mut_yield_expr(&mut self) -> Option<&mut YieldExpr>
pub fn as_mut_yield_expr(&mut self) -> Option<&mut YieldExpr>
Returns Some
if self
is a mutable reference of variant Yield
, and None
otherwise.
pub fn expect_yield_expr(self) -> YieldExpr where
Expr: Debug,
pub fn expect_yield_expr(self) -> YieldExpr where
Expr: Debug,
pub fn yield_expr(self) -> Option<YieldExpr>
pub fn yield_expr(self) -> Option<YieldExpr>
Returns Some
if self
is of variant Yield
, and None
otherwise.
pub fn is_meta_prop(&self) -> bool
pub fn is_meta_prop(&self) -> bool
Returns true
if self
is of variant MetaProp
.
pub fn as_meta_prop(&self) -> Option<&MetaPropExpr>
pub fn as_meta_prop(&self) -> Option<&MetaPropExpr>
Returns Some
if self
is a reference of variant MetaProp
, and None
otherwise.
pub fn as_mut_meta_prop(&mut self) -> Option<&mut MetaPropExpr>
pub fn as_mut_meta_prop(&mut self) -> Option<&mut MetaPropExpr>
Returns Some
if self
is a mutable reference of variant MetaProp
, and None
otherwise.
pub fn expect_meta_prop(self) -> MetaPropExpr where
Expr: Debug,
pub fn expect_meta_prop(self) -> MetaPropExpr where
Expr: Debug,
pub fn meta_prop(self) -> Option<MetaPropExpr>
pub fn meta_prop(self) -> Option<MetaPropExpr>
Returns Some
if self
is of variant MetaProp
, and None
otherwise.
pub fn is_await_expr(&self) -> bool
pub fn is_await_expr(&self) -> bool
Returns true
if self
is of variant Await
.
pub fn as_await_expr(&self) -> Option<&AwaitExpr>
pub fn as_await_expr(&self) -> Option<&AwaitExpr>
Returns Some
if self
is a reference of variant Await
, and None
otherwise.
pub fn as_mut_await_expr(&mut self) -> Option<&mut AwaitExpr>
pub fn as_mut_await_expr(&mut self) -> Option<&mut AwaitExpr>
Returns Some
if self
is a mutable reference of variant Await
, and None
otherwise.
pub fn expect_await_expr(self) -> AwaitExpr where
Expr: Debug,
pub fn expect_await_expr(self) -> AwaitExpr where
Expr: Debug,
pub fn await_expr(self) -> Option<AwaitExpr>
pub fn await_expr(self) -> Option<AwaitExpr>
Returns Some
if self
is of variant Await
, and None
otherwise.
pub fn as_paren(&self) -> Option<&ParenExpr>
pub fn as_paren(&self) -> Option<&ParenExpr>
Returns Some
if self
is a reference of variant Paren
, and None
otherwise.
pub fn as_mut_paren(&mut self) -> Option<&mut ParenExpr>
pub fn as_mut_paren(&mut self) -> Option<&mut ParenExpr>
Returns Some
if self
is a mutable reference of variant Paren
, and None
otherwise.
pub fn expect_paren(self) -> ParenExpr where
Expr: Debug,
pub fn expect_paren(self) -> ParenExpr where
Expr: Debug,
pub fn paren(self) -> Option<ParenExpr>
pub fn paren(self) -> Option<ParenExpr>
Returns Some
if self
is of variant Paren
, and None
otherwise.
pub fn is_jsx_member(&self) -> bool
pub fn is_jsx_member(&self) -> bool
Returns true
if self
is of variant JSXMember
.
pub fn as_jsx_member(&self) -> Option<&JSXMemberExpr>
pub fn as_jsx_member(&self) -> Option<&JSXMemberExpr>
Returns Some
if self
is a reference of variant JSXMember
, and None
otherwise.
pub fn as_mut_jsx_member(&mut self) -> Option<&mut JSXMemberExpr>
pub fn as_mut_jsx_member(&mut self) -> Option<&mut JSXMemberExpr>
Returns Some
if self
is a mutable reference of variant JSXMember
, and None
otherwise.
pub fn expect_jsx_member(self) -> JSXMemberExpr where
Expr: Debug,
pub fn expect_jsx_member(self) -> JSXMemberExpr where
Expr: Debug,
pub fn jsx_member(self) -> Option<JSXMemberExpr>
pub fn jsx_member(self) -> Option<JSXMemberExpr>
Returns Some
if self
is of variant JSXMember
, and None
otherwise.
pub fn is_jsx_namespaced_name(&self) -> bool
pub fn is_jsx_namespaced_name(&self) -> bool
Returns true
if self
is of variant JSXNamespacedName
.
pub fn as_jsx_namespaced_name(&self) -> Option<&JSXNamespacedName>
pub fn as_jsx_namespaced_name(&self) -> Option<&JSXNamespacedName>
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>
pub fn as_mut_jsx_namespaced_name(&mut self) -> Option<&mut JSXNamespacedName>
Returns Some
if self
is a mutable reference of variant JSXNamespacedName
, and None
otherwise.
pub fn expect_jsx_namespaced_name(self) -> JSXNamespacedName where
Expr: Debug,
pub fn expect_jsx_namespaced_name(self) -> JSXNamespacedName where
Expr: Debug,
Unwraps the value, yielding the content of JSXNamespacedName
.
Panics
Panics if the value is not JSXNamespacedName
, with a panic message including the content of self
.
pub fn jsx_namespaced_name(self) -> Option<JSXNamespacedName>
pub fn jsx_namespaced_name(self) -> Option<JSXNamespacedName>
Returns Some
if self
is of variant JSXNamespacedName
, and None
otherwise.
pub fn is_jsx_empty(&self) -> bool
pub fn is_jsx_empty(&self) -> bool
Returns true
if self
is of variant JSXEmpty
.
pub fn as_jsx_empty(&self) -> Option<&JSXEmptyExpr>
pub fn as_jsx_empty(&self) -> Option<&JSXEmptyExpr>
Returns Some
if self
is a reference of variant JSXEmpty
, and None
otherwise.
pub fn as_mut_jsx_empty(&mut self) -> Option<&mut JSXEmptyExpr>
pub fn as_mut_jsx_empty(&mut self) -> Option<&mut JSXEmptyExpr>
Returns Some
if self
is a mutable reference of variant JSXEmpty
, and None
otherwise.
pub fn expect_jsx_empty(self) -> JSXEmptyExpr where
Expr: Debug,
pub fn expect_jsx_empty(self) -> JSXEmptyExpr where
Expr: Debug,
pub fn jsx_empty(self) -> Option<JSXEmptyExpr>
pub fn jsx_empty(self) -> Option<JSXEmptyExpr>
Returns Some
if self
is of variant JSXEmpty
, and None
otherwise.
pub fn is_jsx_element(&self) -> bool
pub fn is_jsx_element(&self) -> bool
Returns true
if self
is of variant JSXElement
.
pub fn as_jsx_element(&self) -> Option<&Box<JSXElement, Global>>
pub fn as_jsx_element(&self) -> Option<&Box<JSXElement, Global>>
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, Global>>
pub fn as_mut_jsx_element(&mut self) -> Option<&mut Box<JSXElement, Global>>
Returns Some
if self
is a mutable reference of variant JSXElement
, and None
otherwise.
pub fn expect_jsx_element(self) -> Box<JSXElement, Global> where
Expr: Debug,
pub fn expect_jsx_element(self) -> Box<JSXElement, Global> where
Expr: Debug,
Unwraps the value, yielding the content of JSXElement
.
Panics
Panics if the value is not JSXElement
, with a panic message including the content of self
.
pub fn jsx_element(self) -> Option<Box<JSXElement, Global>>
pub fn jsx_element(self) -> Option<Box<JSXElement, Global>>
Returns Some
if self
is of variant JSXElement
, and None
otherwise.
pub fn is_jsx_fragment(&self) -> bool
pub fn is_jsx_fragment(&self) -> bool
Returns true
if self
is of variant JSXFragment
.
pub fn as_jsx_fragment(&self) -> Option<&JSXFragment>
pub fn as_jsx_fragment(&self) -> Option<&JSXFragment>
Returns Some
if self
is a reference of variant JSXFragment
, and None
otherwise.
pub fn as_mut_jsx_fragment(&mut self) -> Option<&mut JSXFragment>
pub fn as_mut_jsx_fragment(&mut self) -> Option<&mut JSXFragment>
Returns Some
if self
is a mutable reference of variant JSXFragment
, and None
otherwise.
pub fn expect_jsx_fragment(self) -> JSXFragment where
Expr: Debug,
pub fn expect_jsx_fragment(self) -> JSXFragment where
Expr: Debug,
Unwraps the value, yielding the content of JSXFragment
.
Panics
Panics if the value is not JSXFragment
, with a panic message including the content of self
.
pub fn jsx_fragment(self) -> Option<JSXFragment>
pub fn jsx_fragment(self) -> Option<JSXFragment>
Returns Some
if self
is of variant JSXFragment
, and None
otherwise.
pub fn is_ts_type_assertion(&self) -> bool
pub fn is_ts_type_assertion(&self) -> bool
Returns true
if self
is of variant TsTypeAssertion
.
pub fn as_ts_type_assertion(&self) -> Option<&TsTypeAssertion>
pub fn as_ts_type_assertion(&self) -> Option<&TsTypeAssertion>
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>
pub fn as_mut_ts_type_assertion(&mut self) -> Option<&mut TsTypeAssertion>
Returns Some
if self
is a mutable reference of variant TsTypeAssertion
, and None
otherwise.
pub fn expect_ts_type_assertion(self) -> TsTypeAssertion where
Expr: Debug,
pub fn expect_ts_type_assertion(self) -> TsTypeAssertion where
Expr: Debug,
Unwraps the value, yielding the content of TsTypeAssertion
.
Panics
Panics if the value is not TsTypeAssertion
, with a panic message including the content of self
.
pub fn ts_type_assertion(self) -> Option<TsTypeAssertion>
pub fn ts_type_assertion(self) -> Option<TsTypeAssertion>
Returns Some
if self
is of variant TsTypeAssertion
, and None
otherwise.
pub fn is_ts_const_assertion(&self) -> bool
pub fn is_ts_const_assertion(&self) -> bool
Returns true
if self
is of variant TsConstAssertion
.
pub fn as_ts_const_assertion(&self) -> Option<&TsConstAssertion>
pub fn as_ts_const_assertion(&self) -> Option<&TsConstAssertion>
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>
pub fn as_mut_ts_const_assertion(&mut self) -> Option<&mut TsConstAssertion>
Returns Some
if self
is a mutable reference of variant TsConstAssertion
, and None
otherwise.
pub fn expect_ts_const_assertion(self) -> TsConstAssertion where
Expr: Debug,
pub fn expect_ts_const_assertion(self) -> TsConstAssertion where
Expr: Debug,
Unwraps the value, yielding the content of TsConstAssertion
.
Panics
Panics if the value is not TsConstAssertion
, with a panic message including the content of self
.
pub fn ts_const_assertion(self) -> Option<TsConstAssertion>
pub fn ts_const_assertion(self) -> Option<TsConstAssertion>
Returns Some
if self
is of variant TsConstAssertion
, and None
otherwise.
pub fn is_ts_non_null(&self) -> bool
pub fn is_ts_non_null(&self) -> bool
Returns true
if self
is of variant TsNonNull
.
pub fn as_ts_non_null(&self) -> Option<&TsNonNullExpr>
pub fn as_ts_non_null(&self) -> Option<&TsNonNullExpr>
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>
pub fn as_mut_ts_non_null(&mut self) -> Option<&mut TsNonNullExpr>
Returns Some
if self
is a mutable reference of variant TsNonNull
, and None
otherwise.
pub fn expect_ts_non_null(self) -> TsNonNullExpr where
Expr: Debug,
pub fn expect_ts_non_null(self) -> TsNonNullExpr where
Expr: Debug,
pub fn ts_non_null(self) -> Option<TsNonNullExpr>
pub fn ts_non_null(self) -> Option<TsNonNullExpr>
Returns Some
if self
is of variant TsNonNull
, and None
otherwise.
pub fn as_ts_as(&self) -> Option<&TsAsExpr>
pub fn as_ts_as(&self) -> Option<&TsAsExpr>
Returns Some
if self
is a reference of variant TsAs
, and None
otherwise.
pub fn as_mut_ts_as(&mut self) -> Option<&mut TsAsExpr>
pub fn as_mut_ts_as(&mut self) -> Option<&mut TsAsExpr>
Returns Some
if self
is a mutable reference of variant TsAs
, and None
otherwise.
pub fn expect_ts_as(self) -> TsAsExpr where
Expr: Debug,
pub fn expect_ts_as(self) -> TsAsExpr where
Expr: Debug,
pub fn is_ts_instantiation(&self) -> bool
pub fn is_ts_instantiation(&self) -> bool
Returns true
if self
is of variant TsInstantiation
.
pub fn as_ts_instantiation(&self) -> Option<&TsInstantiation>
pub fn as_ts_instantiation(&self) -> Option<&TsInstantiation>
Returns Some
if self
is a reference of variant TsInstantiation
, and None
otherwise.
pub fn as_mut_ts_instantiation(&mut self) -> Option<&mut TsInstantiation>
pub fn as_mut_ts_instantiation(&mut self) -> Option<&mut TsInstantiation>
Returns Some
if self
is a mutable reference of variant TsInstantiation
, and None
otherwise.
pub fn expect_ts_instantiation(self) -> TsInstantiation where
Expr: Debug,
pub fn expect_ts_instantiation(self) -> TsInstantiation where
Expr: Debug,
Unwraps the value, yielding the content of TsInstantiation
.
Panics
Panics if the value is not TsInstantiation
, with a panic message including the content of self
.
pub fn ts_instantiation(self) -> Option<TsInstantiation>
pub fn ts_instantiation(self) -> Option<TsInstantiation>
Returns Some
if self
is of variant TsInstantiation
, and None
otherwise.
pub fn is_private_name(&self) -> bool
pub fn is_private_name(&self) -> bool
Returns true
if self
is of variant PrivateName
.
pub fn as_private_name(&self) -> Option<&PrivateName>
pub fn as_private_name(&self) -> Option<&PrivateName>
Returns Some
if self
is a reference of variant PrivateName
, and None
otherwise.
pub fn as_mut_private_name(&mut self) -> Option<&mut PrivateName>
pub fn as_mut_private_name(&mut self) -> Option<&mut PrivateName>
Returns Some
if self
is a mutable reference of variant PrivateName
, and None
otherwise.
pub fn expect_private_name(self) -> PrivateName where
Expr: Debug,
pub fn expect_private_name(self) -> PrivateName where
Expr: Debug,
Unwraps the value, yielding the content of PrivateName
.
Panics
Panics if the value is not PrivateName
, with a panic message including the content of self
.
pub fn private_name(self) -> Option<PrivateName>
pub fn private_name(self) -> Option<PrivateName>
Returns Some
if self
is of variant PrivateName
, and None
otherwise.
pub fn is_opt_chain(&self) -> bool
pub fn is_opt_chain(&self) -> bool
Returns true
if self
is of variant OptChain
.
pub fn as_opt_chain(&self) -> Option<&OptChainExpr>
pub fn as_opt_chain(&self) -> Option<&OptChainExpr>
Returns Some
if self
is a reference of variant OptChain
, and None
otherwise.
pub fn as_mut_opt_chain(&mut self) -> Option<&mut OptChainExpr>
pub fn as_mut_opt_chain(&mut self) -> Option<&mut OptChainExpr>
Returns Some
if self
is a mutable reference of variant OptChain
, and None
otherwise.
pub fn expect_opt_chain(self) -> OptChainExpr where
Expr: Debug,
pub fn expect_opt_chain(self) -> OptChainExpr where
Expr: Debug,
pub fn opt_chain(self) -> Option<OptChainExpr>
pub fn opt_chain(self) -> Option<OptChainExpr>
Returns Some
if self
is of variant OptChain
, and None
otherwise.
pub fn is_invalid(&self) -> bool
pub fn is_invalid(&self) -> bool
Returns true
if self
is of variant Invalid
.
pub fn as_invalid(&self) -> Option<&Invalid>
pub fn as_invalid(&self) -> Option<&Invalid>
Returns Some
if self
is a reference of variant Invalid
, and None
otherwise.
pub fn as_mut_invalid(&mut self) -> Option<&mut Invalid>
pub fn as_mut_invalid(&mut self) -> Option<&mut Invalid>
Returns Some
if self
is a mutable reference of variant Invalid
, and None
otherwise.
pub fn expect_invalid(self) -> Invalid where
Expr: Debug,
pub fn expect_invalid(self) -> Invalid where
Expr: Debug,
impl Expr
impl Expr
pub fn unwrap_parens(&self) -> &Expr
pub fn unwrap_parens(&self) -> &Expr
Normalize parenthesized expressions.
This will normalize (foo)
, ((foo))
, … to foo
.
If self
is not a parenthesized expression, it will be returned as is.
pub fn unwrap_parens_mut(&mut self) -> &mut Expr
pub fn unwrap_parens_mut(&mut self) -> &mut Expr
Normalize parenthesized expressions.
This will normalize (foo)
, ((foo))
, … to foo
.
If self
is not a parenthesized expression, it will be returned as is.
Trait Implementations
impl Archive for Expr
impl Archive for Expr
impl<'de> Deserialize<'de> for Expr
impl<'de> Deserialize<'de> for Expr
fn 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
impl<__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,
fn 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 EqIgnoreSpan for Expr
impl EqIgnoreSpan for Expr
fn eq_ignore_span(&self, other: &Expr) -> bool
impl ExprExt for Box<Expr, Global>
impl ExprExt for Box<Expr, Global>
fn as_expr(&self) -> &Expr
fn 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
fn 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.
fn 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.
fn 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.
fn 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>)
fn as_pure_number(&self, ctx: &ExprCtx) -> 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>>
fn as_pure_string(&self, ctx: &ExprCtx) -> Value<Cow<'_, str>>
Returns Known only if it’s pure.
fn 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
impl ExprExt for Expr
impl ExprExt for Expr
fn as_expr(&self) -> &Expr
fn 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
fn 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.
fn 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.
fn 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.
fn 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>)
fn as_pure_number(&self, ctx: &ExprCtx) -> 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>>
fn as_pure_string(&self, ctx: &ExprCtx) -> Value<Cow<'_, str>>
Returns Known only if it’s pure.
fn 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
impl From<(Atom<JsWordStaticSet>, SyntaxContext)> for Box<Expr, Global>
impl From<(Atom<JsWordStaticSet>, SyntaxContext)> for Box<Expr, Global>
fn 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.
impl From<(Atom<JsWordStaticSet>, SyntaxContext)> for Expr
impl From<(Atom<JsWordStaticSet>, SyntaxContext)> for Expr
fn from(src: (Atom<JsWordStaticSet>, SyntaxContext)) -> Expr
fn from(src: (Atom<JsWordStaticSet>, SyntaxContext)) -> Expr
Converts to this type from the input type.
impl From<AssignExpr> for Expr
impl From<AssignExpr> for Expr
fn from(v: AssignExpr) -> Expr
fn from(v: AssignExpr) -> Expr
Converts to this type from the input type.
impl From<Atom<JsWordStaticSet>> for Box<Expr, Global>
impl From<Atom<JsWordStaticSet>> for Box<Expr, Global>
fn from(src: Atom<JsWordStaticSet>) -> Box<Expr, Global>
fn from(src: Atom<JsWordStaticSet>) -> Box<Expr, Global>
Converts to this type from the input type.
impl From<Atom<JsWordStaticSet>> for Expr
impl From<Atom<JsWordStaticSet>> for Expr
fn from(src: Atom<JsWordStaticSet>) -> Expr
fn from(src: Atom<JsWordStaticSet>) -> Expr
Converts to this type from the input type.
impl From<Box<JSXElement, Global>> for Expr
impl From<Box<JSXElement, Global>> for Expr
fn from(v: Box<JSXElement, Global>) -> Expr
fn from(v: Box<JSXElement, Global>) -> Expr
Converts to this type from the input type.
impl From<Expr> for ExprOrSpread
impl From<Expr> for ExprOrSpread
fn from(e: Expr) -> ExprOrSpread
fn from(e: Expr) -> ExprOrSpread
Converts to this type from the input type.
impl From<JSXEmptyExpr> for Expr
impl From<JSXEmptyExpr> for Expr
fn from(v: JSXEmptyExpr) -> Expr
fn from(v: JSXEmptyExpr) -> Expr
Converts to this type from the input type.
impl From<JSXFragment> for Expr
impl From<JSXFragment> for Expr
fn from(v: JSXFragment) -> Expr
fn from(v: JSXFragment) -> Expr
Converts to this type from the input type.
impl From<JSXMemberExpr> for Expr
impl From<JSXMemberExpr> for Expr
fn from(v: JSXMemberExpr) -> Expr
fn from(v: JSXMemberExpr) -> Expr
Converts to this type from the input type.
impl From<JSXNamespacedName> for Expr
impl From<JSXNamespacedName> for Expr
fn from(v: JSXNamespacedName) -> Expr
fn from(v: JSXNamespacedName) -> Expr
Converts to this type from the input type.
impl From<MemberExpr> for Expr
impl From<MemberExpr> for Expr
fn from(v: MemberExpr) -> Expr
fn from(v: MemberExpr) -> Expr
Converts to this type from the input type.
impl From<MetaPropExpr> for Expr
impl From<MetaPropExpr> for Expr
fn from(v: MetaPropExpr) -> Expr
fn from(v: MetaPropExpr) -> Expr
Converts to this type from the input type.
impl From<OptChainBase> for Expr
impl From<OptChainBase> for Expr
fn from(opt: OptChainBase) -> Expr
fn from(opt: OptChainBase) -> Expr
Converts to this type from the input type.
impl From<OptChainExpr> for Expr
impl From<OptChainExpr> for Expr
fn from(v: OptChainExpr) -> Expr
fn from(v: OptChainExpr) -> Expr
Converts to this type from the input type.
impl From<PrivateName> for Expr
impl From<PrivateName> for Expr
fn from(v: PrivateName) -> Expr
fn from(v: PrivateName) -> Expr
Converts to this type from the input type.
impl From<SuperPropExpr> for Expr
impl From<SuperPropExpr> for Expr
fn from(v: SuperPropExpr) -> Expr
fn from(v: SuperPropExpr) -> Expr
Converts to this type from the input type.
impl From<TsConstAssertion> for Expr
impl From<TsConstAssertion> for Expr
fn from(v: TsConstAssertion) -> Expr
fn from(v: TsConstAssertion) -> Expr
Converts to this type from the input type.
impl From<TsInstantiation> for Expr
impl From<TsInstantiation> for Expr
fn from(v: TsInstantiation) -> Expr
fn from(v: TsInstantiation) -> Expr
Converts to this type from the input type.
impl From<TsNonNullExpr> for Expr
impl From<TsNonNullExpr> for Expr
fn from(v: TsNonNullExpr) -> Expr
fn from(v: TsNonNullExpr) -> Expr
Converts to this type from the input type.
impl From<TsTypeAssertion> for Expr
impl From<TsTypeAssertion> for Expr
fn from(v: TsTypeAssertion) -> Expr
fn from(v: TsTypeAssertion) -> Expr
Converts to this type from the input type.
impl From<UpdateExpr> for Expr
impl From<UpdateExpr> for Expr
fn from(v: UpdateExpr) -> Expr
fn from(v: UpdateExpr) -> Expr
Converts to this type from the input type.
impl Into<Expr> for FunctionWrapper<Expr>
impl Into<Expr> for FunctionWrapper<Expr>
fn 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<__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,
impl Serialize for Expr
impl Serialize for Expr
fn 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<V> VisitAllWith<V> for Expr where
V: VisitAll + ?Sized,
impl<V> VisitAllWith<V> for Expr where
V: VisitAll + ?Sized,
fn visit_all_with(&self, v: &mut V)
fn visit_all_with(&self, v: &mut V)
Calls a visitor method (v.visit_xxx) with self.
fn visit_all_children_with(&self, _visitor: &mut V)
fn visit_all_children_with(&self, _visitor: &mut V)
Visit children nodes of self with v
impl<V> VisitMutWith<V> for Expr where
V: VisitMut + ?Sized,
impl<V> VisitMutWith<V> for Expr where
V: VisitMut + ?Sized,
fn 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)
impl<V> VisitWith<V> for Expr where
V: Visit + ?Sized,
impl<V> VisitWith<V> for Expr where
V: Visit + ?Sized,
fn visit_with(&self, v: &mut V)
fn visit_with(&self, v: &mut V)
Calls a visitor method (v.visit_xxx) with self.
fn 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.
impl<T> ExprFactory for T where
T: Into<Expr>,
impl<T> ExprFactory for T where
T: Into<Expr>,
fn 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
fn 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
fn 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
fn 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
fn 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
fn 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
fn 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> 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<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.
impl<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
fn 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