pub enum ExprKind<'ast> {
Show 17 variants
Array(BoxSlice<'ast, Box<'ast, Expr<'ast>>>),
Assign(Box<'ast, Expr<'ast>>, Option<BinOp>, Box<'ast, Expr<'ast>>),
Binary(Box<'ast, Expr<'ast>>, BinOp, Box<'ast, Expr<'ast>>),
Call(Box<'ast, Expr<'ast>>, CallArgs<'ast>),
CallOptions(Box<'ast, Expr<'ast>>, NamedArgList<'ast>),
Delete(Box<'ast, Expr<'ast>>),
Ident(Ident),
Index(Box<'ast, Expr<'ast>>, IndexKind<'ast>),
Lit(Box<'ast, Lit<'ast>>, Option<SubDenomination>),
Member(Box<'ast, Expr<'ast>>, Ident),
New(Type<'ast>),
Payable(CallArgs<'ast>),
Ternary(Box<'ast, Expr<'ast>>, Box<'ast, Expr<'ast>>, Box<'ast, Expr<'ast>>),
Tuple(BoxSlice<'ast, SpannedOption<Box<'ast, Expr<'ast>>>>),
TypeCall(Type<'ast>),
Type(Type<'ast>),
Unary(UnOp, Box<'ast, Expr<'ast>>),
}Expand description
A kind of expression.
Variants§
Array(BoxSlice<'ast, Box<'ast, Expr<'ast>>>)
An array literal expression: [a, b, c, d].
Assign(Box<'ast, Expr<'ast>>, Option<BinOp>, Box<'ast, Expr<'ast>>)
An assignment: a = b, a += b.
Binary(Box<'ast, Expr<'ast>>, BinOp, Box<'ast, Expr<'ast>>)
A binary operation: a + b, a >> b.
Call(Box<'ast, Expr<'ast>>, CallArgs<'ast>)
A function call expression: foo(42) or foo({ bar: 42 }).
CallOptions(Box<'ast, Expr<'ast>>, NamedArgList<'ast>)
Function call options: foo.bar{ value: 1, gas: 2 }.
Delete(Box<'ast, Expr<'ast>>)
A unary delete expression: delete vector.
Ident(Ident)
An identifier: foo.
Index(Box<'ast, Expr<'ast>>, IndexKind<'ast>)
A square bracketed indexing expression: vector[index], slice[l:r].
Lit(Box<'ast, 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(Box<'ast, 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(Box<'ast, Expr<'ast>>, Box<'ast, Expr<'ast>>, Box<'ast, Expr<'ast>>)
A ternary (AKA conditional) expression: foo ? bar : baz.
Tuple(BoxSlice<'ast, SpannedOption<Box<'ast, 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, Box<'ast, 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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 40 bytes
Size for each variant:
Array: 15 bytesAssign: 31 bytesBinary: 31 bytesCall: 39 bytesCallOptions: 23 bytesDelete: 15 bytesIdent: 15 bytesIndex: 39 bytesLit: 15 bytesMember: 23 bytesNew: 31 bytesPayable: 31 bytesTernary: 31 bytesTuple: 15 bytesTypeCall: 31 bytesType: 31 bytesUnary: 23 bytes