pub enum ExprKind<U = ()> {
Show 27 variants BoolOp { op: Boolop, values: Vec<Expr<U>>, }, NamedExpr { target: Box<Expr<U>>, value: Box<Expr<U>>, }, BinOp { left: Box<Expr<U>>, op: Operator, right: Box<Expr<U>>, }, UnaryOp { op: Unaryop, operand: Box<Expr<U>>, }, Lambda { args: Box<Arguments<U>>, body: Box<Expr<U>>, }, IfExp { test: Box<Expr<U>>, body: Box<Expr<U>>, orelse: Box<Expr<U>>, }, Dict { keys: Vec<Expr<U>>, values: Vec<Expr<U>>, }, Set { elts: Vec<Expr<U>>, }, ListComp { elt: Box<Expr<U>>, generators: Vec<Comprehension<U>>, }, SetComp { elt: Box<Expr<U>>, generators: Vec<Comprehension<U>>, }, DictComp { key: Box<Expr<U>>, value: Box<Expr<U>>, generators: Vec<Comprehension<U>>, }, GeneratorExp { elt: Box<Expr<U>>, generators: Vec<Comprehension<U>>, }, Await { value: Box<Expr<U>>, }, Yield { value: Option<Box<Expr<U>>>, }, YieldFrom { value: Box<Expr<U>>, }, Compare { left: Box<Expr<U>>, ops: Vec<Cmpop>, comparators: Vec<Expr<U>>, }, Call { func: Box<Expr<U>>, args: Vec<Expr<U>>, keywords: Vec<Keyword<U>>, }, FormattedValue { value: Box<Expr<U>>, conversion: usize, format_spec: Option<Box<Expr<U>>>, }, JoinedStr { values: Vec<Expr<U>>, }, Constant { value: Constant, kind: Option<String>, }, Attribute { value: Box<Expr<U>>, attr: String, ctx: ExprContext, }, Subscript { value: Box<Expr<U>>, slice: Box<Expr<U>>, ctx: ExprContext, }, Starred { value: Box<Expr<U>>, ctx: ExprContext, }, Name { id: String, ctx: ExprContext, }, List { elts: Vec<Expr<U>>, ctx: ExprContext, }, Tuple { elts: Vec<Expr<U>>, ctx: ExprContext, }, Slice { lower: Option<Box<Expr<U>>>, upper: Option<Box<Expr<U>>>, step: Option<Box<Expr<U>>>, },
}

Variants§

§

BoolOp

Fields

§values: Vec<Expr<U>>
§

NamedExpr

Fields

§target: Box<Expr<U>>
§value: Box<Expr<U>>
§

BinOp

Fields

§left: Box<Expr<U>>
§right: Box<Expr<U>>
§

UnaryOp

Fields

§operand: Box<Expr<U>>
§

Lambda

Fields

§args: Box<Arguments<U>>
§body: Box<Expr<U>>
§

IfExp

Fields

§test: Box<Expr<U>>
§body: Box<Expr<U>>
§orelse: Box<Expr<U>>
§

Dict

Fields

§keys: Vec<Expr<U>>
§values: Vec<Expr<U>>
§

Set

Fields

§elts: Vec<Expr<U>>
§

ListComp

Fields

§elt: Box<Expr<U>>
§generators: Vec<Comprehension<U>>
§

SetComp

Fields

§elt: Box<Expr<U>>
§generators: Vec<Comprehension<U>>
§

DictComp

Fields

§key: Box<Expr<U>>
§value: Box<Expr<U>>
§generators: Vec<Comprehension<U>>
§

GeneratorExp

Fields

§elt: Box<Expr<U>>
§generators: Vec<Comprehension<U>>
§

Await

Fields

§value: Box<Expr<U>>
§

Yield

Fields

§value: Option<Box<Expr<U>>>
§

YieldFrom

Fields

§value: Box<Expr<U>>
§

Compare

Fields

§left: Box<Expr<U>>
§ops: Vec<Cmpop>
§comparators: Vec<Expr<U>>
§

Call

Fields

§func: Box<Expr<U>>
§args: Vec<Expr<U>>
§keywords: Vec<Keyword<U>>
§

FormattedValue

Fields

§value: Box<Expr<U>>
§conversion: usize
§format_spec: Option<Box<Expr<U>>>
§

JoinedStr

Fields

§values: Vec<Expr<U>>
§

Constant

Fields

§value: Constant
§

Attribute

Fields

§value: Box<Expr<U>>
§attr: String
§

Subscript

Fields

§value: Box<Expr<U>>
§slice: Box<Expr<U>>
§

Starred

Fields

§value: Box<Expr<U>>
§

Name

Fields

§

List

Fields

§elts: Vec<Expr<U>>
§

Tuple

Fields

§elts: Vec<Expr<U>>
§

Slice

Fields

§lower: Option<Box<Expr<U>>>
§upper: Option<Box<Expr<U>>>
§step: Option<Box<Expr<U>>>

Implementations§

Returns a short name for the node suitable for use in error messages.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.