pub enum ExprKind<'ast> {
Show 17 variants
Array(&'ast mut RawThinSlice<(), &'ast mut Expr<'ast>>),
Assign(&'ast mut Expr<'ast>, Option<BinOp>, &'ast mut Expr<'ast>),
Binary(&'ast mut Expr<'ast>, BinOp, &'ast mut Expr<'ast>),
Call(&'ast mut Expr<'ast>, CallArgs<'ast>),
CallOptions(&'ast mut Expr<'ast>, &'ast mut RawThinSlice<(), NamedArg<'ast>>),
Delete(&'ast mut Expr<'ast>),
Ident(Ident),
Index(&'ast mut Expr<'ast>, IndexKind<'ast>),
Lit(&'ast mut Lit<'ast>, Option<SubDenomination>),
Member(&'ast mut Expr<'ast>, Ident),
New(Type<'ast>),
Payable(CallArgs<'ast>),
Ternary(&'ast mut Expr<'ast>, &'ast mut Expr<'ast>, &'ast mut Expr<'ast>),
Tuple(&'ast mut RawThinSlice<(), SpannedOption<&'ast mut Expr<'ast>>>),
TypeCall(Type<'ast>),
Type(Type<'ast>),
Unary(UnOp, &'ast mut Expr<'ast>),
}Expand description
A kind of expression.
Variants§
Array(&'ast mut RawThinSlice<(), &'ast mut Expr<'ast>>)
An array literal expression: [a, b, c, d].
Assign(&'ast mut Expr<'ast>, Option<BinOp>, &'ast mut Expr<'ast>)
An assignment: a = b, a += b.
Binary(&'ast mut Expr<'ast>, BinOp, &'ast mut Expr<'ast>)
A binary operation: a + b, a >> b.
Call(&'ast mut Expr<'ast>, CallArgs<'ast>)
A function call expression: foo(42) or foo({ bar: 42 }).
CallOptions(&'ast mut Expr<'ast>, &'ast mut RawThinSlice<(), NamedArg<'ast>>)
Function call options: foo.bar{ value: 1, gas: 2 }.
Delete(&'ast mut Expr<'ast>)
A unary delete expression: delete vector.
Ident(Ident)
An identifier: foo.
Index(&'ast mut Expr<'ast>, IndexKind<'ast>)
A square bracketed indexing expression: vector[index], slice[l:r].
Lit(&'ast mut Lit<'ast>, Option<SubDenomination>)
A literal: hex"1234", 5.6 ether.
Note that the SubDenomination is only present for numeric literals, and it’s already
applied to Lit’s value. It is only present for error reporting/formatting purposes.
Member(&'ast mut Expr<'ast>, Ident)
Access of a named member: obj.k.
New(Type<'ast>)
A new expression: new Contract.
Payable(CallArgs<'ast>)
A payable expression: payable(address(0x...)).
Ternary(&'ast mut Expr<'ast>, &'ast mut Expr<'ast>, &'ast mut Expr<'ast>)
A ternary (AKA conditional) expression: foo ? bar : baz.
Tuple(&'ast mut RawThinSlice<(), SpannedOption<&'ast mut Expr<'ast>>>)
A tuple expression: (a,,, b, c, d).
TypeCall(Type<'ast>)
A type() expression: type(uint256).
Type(Type<'ast>)
An elementary type name: uint256.
Unary(UnOp, &'ast mut Expr<'ast>)
A unary operation: !x, -x, x++.
Trait Implementations§
Auto Trait Implementations§
impl<'ast> Freeze for ExprKind<'ast>
impl<'ast> RefUnwindSafe for ExprKind<'ast>
impl<'ast> Send for ExprKind<'ast>
impl<'ast> Sync for ExprKind<'ast>
impl<'ast> Unpin for ExprKind<'ast>
impl<'ast> !UnwindSafe for ExprKind<'ast>
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
Source§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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> ⓘ
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> ⓘ
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