pub enum Expression {
Show 32 variants
Ellipsis,
None,
True,
False,
Name(Name),
Int(IntegerType),
ImaginaryInt(IntegerType),
Float(f64),
ImaginaryFloat(f64),
String(Vec<PyString>),
Bytes(Vec<u8>),
DictLiteral(Vec<DictItem>),
SetLiteral(Vec<SetItem>),
ListLiteral(Vec<SetItem>),
TupleLiteral(Vec<SetItem>),
DictComp(Box<DictItem>, Vec<ComprehensionChunk>),
SetComp(Box<SetItem>, Vec<ComprehensionChunk>),
ListComp(Box<SetItem>, Vec<ComprehensionChunk>),
Generator(Box<SetItem>, Vec<ComprehensionChunk>),
Await(Box<Expression>),
Call(Box<Expression>, Vec<Argument>),
Subscript(Box<Expression>, Vec<Subscript>),
Attribute(Box<Expression>, Name),
Uop(Uop, Box<Expression>),
Bop(Bop, Box<Expression>, Box<Expression>),
MultiBop(Box<Expression>, Vec<(Bop, Expression)>),
Ternary(Box<Expression>, Box<Expression>, Box<Expression>),
Yield(Vec<Expression>),
YieldFrom(Box<Expression>),
Star(Box<Expression>),
Lambdef(UntypedArgsList, Box<Expression>),
Named(Box<Expression>, Box<Expression>),
}
Expand description
The big thing: a Python expression.
Variants§
Ellipsis
None
True
False
Name(Name)
Int(IntegerType)
ImaginaryInt(IntegerType)
Float(f64)
ImaginaryFloat(f64)
String(Vec<PyString>)
Bytes(Vec<u8>)
DictLiteral(Vec<DictItem>)
SetLiteral(Vec<SetItem>)
ListLiteral(Vec<SetItem>)
TupleLiteral(Vec<SetItem>)
DictComp(Box<DictItem>, Vec<ComprehensionChunk>)
SetComp(Box<SetItem>, Vec<ComprehensionChunk>)
ListComp(Box<SetItem>, Vec<ComprehensionChunk>)
Generator(Box<SetItem>, Vec<ComprehensionChunk>)
Await(Box<Expression>)
Call(Box<Expression>, Vec<Argument>)
Subscript(Box<Expression>, Vec<Subscript>)
Attribute(Box<Expression>, Name)
foo.bar
Uop(Uop, Box<Expression>)
Unary operator
Bop(Bop, Box<Expression>, Box<Expression>)
Binary operator. A simplified version of MultiBop
, when the
expressivity of MultiBop is not needed.
MultiBop(Box<Expression>, Vec<(Bop, Expression)>)
Binary operator… but may be applied on more than one expr
(eg. a <= b < c
)
Ternary(Box<Expression>, Box<Expression>, Box<Expression>)
1 if 2 else 3
Yield(Vec<Expression>)
YieldFrom(Box<Expression>)
Star(Box<Expression>)
Lambdef(UntypedArgsList, Box<Expression>)
Named(Box<Expression>, Box<Expression>)
Walrus operator: 1 := 2
Trait Implementations§
Source§impl Clone for Expression
impl Clone for Expression
Source§fn clone(&self) -> Expression
fn clone(&self) -> Expression
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for Expression
impl Debug for Expression
Source§impl PartialEq for Expression
impl PartialEq for Expression
impl StructuralPartialEq for Expression
Auto Trait Implementations§
impl Freeze for Expression
impl RefUnwindSafe for Expression
impl Send for Expression
impl Sync for Expression
impl Unpin for Expression
impl UnwindSafe for Expression
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