pub enum AstExprKind<'db> {
Show 14 variants
Block(AstBlock<'db>),
Literal(Literal<'db>),
Id(SpannedIdentifier<'db>),
DotId(AstExpr<'db>, SpannedIdentifier<'db>),
SquareBracketOp(AstExpr<'db>, SquareBracketArgs<'db>),
ParenthesisOp(AstExpr<'db>, SpanVec<'db, AstExpr<'db>>),
Tuple(SpanVec<'db, AstExpr<'db>>),
Constructor(AstPath<'db>, SpanVec<'db, AstConstructorField<'db>>),
Return(Option<AstExpr<'db>>),
Await {
future: AstExpr<'db>,
await_keyword: Span<'db>,
},
PermissionOp {
value: AstExpr<'db>,
op: PermissionOp,
},
BinaryOp(SpannedBinaryOp<'db>, AstExpr<'db>, AstExpr<'db>),
UnaryOp(SpannedUnaryOp<'db>, AstExpr<'db>),
If(Vec<IfArm<'db>>),
}Variants§
Block(AstBlock<'db>)
{ ... }
Literal(Literal<'db>)
22
Id(SpannedIdentifier<'db>)
x
DotId(AstExpr<'db>, SpannedIdentifier<'db>)
E.f
Note that this is not necessarily a field. Interpretation is needed.
SquareBracketOp(AstExpr<'db>, SquareBracketArgs<'db>)
E[..]
Note that we cannot parse the contents of the [..]
until we have resolved the expression E.
ParenthesisOp(AstExpr<'db>, SpanVec<'db, AstExpr<'db>>)
E(expr0, expr1, ..., exprN)
Note that the callee expression could also be
a DotId in which case this is a method call
as well as a SquareBracketsOp.
Tuple(SpanVec<'db, AstExpr<'db>>)
(a, b, c)
Could also be (a).
Constructor(AstPath<'db>, SpanVec<'db, AstConstructorField<'db>>)
a { field: value }
Return(Option<AstExpr<'db>>)
return x
Await
x.await
PermissionOp
x.lease, x.ref, or x.give
BinaryOp(SpannedBinaryOp<'db>, AstExpr<'db>, AstExpr<'db>)
a + b etc
UnaryOp(SpannedUnaryOp<'db>, AstExpr<'db>)
!foo etc
If(Vec<IfArm<'db>>)
If/else-if chain
Trait Implementations§
Source§impl<'db> Clone for AstExprKind<'db>
impl<'db> Clone for AstExprKind<'db>
Source§fn clone(&self) -> AstExprKind<'db>
fn clone(&self) -> AstExprKind<'db>
Returns a duplicate 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<'db> Debug for AstExprKind<'db>
impl<'db> Debug for AstExprKind<'db>
Source§impl<'db> Hash for AstExprKind<'db>
impl<'db> Hash for AstExprKind<'db>
Source§impl<'db> Ord for AstExprKind<'db>
impl<'db> Ord for AstExprKind<'db>
Source§fn cmp(&self, other: &AstExprKind<'db>) -> Ordering
fn cmp(&self, other: &AstExprKind<'db>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<'db> PartialEq for AstExprKind<'db>
impl<'db> PartialEq for AstExprKind<'db>
Source§impl<'db> PartialOrd for AstExprKind<'db>
impl<'db> PartialOrd for AstExprKind<'db>
Source§impl<'db> Serialize for AstExprKind<'db>
impl<'db> Serialize for AstExprKind<'db>
Source§impl<'db> Update for AstExprKind<'db>
impl<'db> Update for AstExprKind<'db>
impl<'db> Eq for AstExprKind<'db>
impl<'db> StructuralPartialEq for AstExprKind<'db>
Auto Trait Implementations§
impl<'db> Freeze for AstExprKind<'db>
impl<'db> !RefUnwindSafe for AstExprKind<'db>
impl<'db> Send for AstExprKind<'db>
impl<'db> Sync for AstExprKind<'db>
impl<'db> Unpin for AstExprKind<'db>
impl<'db> UnsafeUnpin for AstExprKind<'db>
impl<'db> !UnwindSafe for AstExprKind<'db>
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,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> HashEqLike<T> for T
impl<T> HashEqLike<T> for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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