pub enum JsExpr {
Show 20 variants
Identifier(String, Span, Trivia),
Literal(NargoValue, Span, Trivia),
Unary {
op: String,
argument: Box<JsExpr>,
span: Span,
trivia: Trivia,
},
Binary {
left: Box<JsExpr>,
op: String,
right: Box<JsExpr>,
span: Span,
trivia: Trivia,
},
Call {
callee: Box<JsExpr>,
args: Vec<JsExpr>,
span: Span,
trivia: Trivia,
},
Member {
object: Box<JsExpr>,
property: Box<JsExpr>,
computed: bool,
span: Span,
trivia: Trivia,
},
OptionalMember {
object: Box<JsExpr>,
property: Box<JsExpr>,
computed: bool,
span: Span,
trivia: Trivia,
},
OptionalCall {
callee: Box<JsExpr>,
args: Vec<JsExpr>,
span: Span,
trivia: Trivia,
},
NullishCoalescing {
left: Box<JsExpr>,
right: Box<JsExpr>,
span: Span,
trivia: Trivia,
},
LogicalAssignment {
op: String,
left: Box<JsExpr>,
right: Box<JsExpr>,
span: Span,
trivia: Trivia,
},
Array(Vec<JsExpr>, Span, Trivia),
Object(HashMap<String, JsExpr>, Span, Trivia),
ArrowFunction {
params: Vec<String>,
body: Box<JsExpr>,
span: Span,
trivia: Trivia,
},
TseElement {
tag: String,
attributes: Vec<TseAttribute>,
children: Vec<JsExpr>,
span: Span,
trivia: Trivia,
},
Conditional {
test: Box<JsExpr>,
consequent: Box<JsExpr>,
alternate: Box<JsExpr>,
span: Span,
trivia: Trivia,
},
TemplateLiteral {
quasis: Vec<String>,
expressions: Vec<JsExpr>,
span: Span,
trivia: Trivia,
},
Spread(Box<JsExpr>, Span, Trivia),
TypeOf(Box<JsExpr>, Span, Trivia),
InstanceOf {
left: Box<JsExpr>,
right: Box<JsExpr>,
span: Span,
trivia: Trivia,
},
Other(String, Span, Trivia),
}Expand description
JavaScript 表达式
Variants§
Identifier(String, Span, Trivia)
标识符
Literal(NargoValue, Span, Trivia)
字面量
Unary
一元表达式
Binary
二元表达式
Fields
Call
函数调用
Member
成员访问
Fields
OptionalMember
可选链成员访问
Fields
OptionalCall
可选链函数调用
NullishCoalescing
空值合并表达式
LogicalAssignment
逻辑赋值表达式
Fields
Array(Vec<JsExpr>, Span, Trivia)
数组字面量
Object(HashMap<String, JsExpr>, Span, Trivia)
对象字面量
ArrowFunction
箭头函数
TseElement
TSE 元素
Fields
§
attributes: Vec<TseAttribute>属性列表
Conditional
条件表达式
Fields
TemplateLiteral
模板字面量
Fields
Spread(Box<JsExpr>, Span, Trivia)
展开表达式
TypeOf(Box<JsExpr>, Span, Trivia)
类型测试表达式
InstanceOf
实例测试表达式
Other(String, Span, Trivia)
其他表达式
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for JsExpr
impl<'de> Deserialize<'de> for JsExpr
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<JsExpr, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<JsExpr, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for JsExpr
impl Serialize for JsExpr
Source§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 StructuralPartialEq for JsExpr
Auto Trait Implementations§
impl Freeze for JsExpr
impl RefUnwindSafe for JsExpr
impl Send for JsExpr
impl Sync for JsExpr
impl Unpin for JsExpr
impl UnsafeUnpin for JsExpr
impl UnwindSafe for JsExpr
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more