Enum Expr
pub(crate) enum Expr {
Show 36 variants
Missing,
Path(Path),
If {
condition: Idx<Expr>,
then_branch: Idx<Expr>,
else_branch: Option<Idx<Expr>>,
},
Let {
pat: Idx<Pat>,
expr: Idx<Expr>,
},
Block {
id: Option<BlockIdLt<'static>>,
statements: Box<[Statement]>,
tail: Option<Idx<Expr>>,
label: Option<Idx<Label>>,
},
Const(Idx<Expr>),
Unsafe {
id: Option<BlockIdLt<'static>>,
statements: Box<[Statement]>,
tail: Option<Idx<Expr>>,
},
Loop {
body: Idx<Expr>,
label: Option<Idx<Label>>,
source: LoopSource,
},
Call {
callee: Idx<Expr>,
args: Box<[Idx<Expr>]>,
},
MethodCall {
receiver: Idx<Expr>,
method_name: Name,
args: Box<[Idx<Expr>]>,
generic_args: Option<Box<GenericArgs>>,
},
Match {
expr: Idx<Expr>,
arms: Box<[MatchArm]>,
},
Continue {
label: Option<Idx<Label>>,
},
Break {
expr: Option<Idx<Expr>>,
label: Option<Idx<Label>>,
},
Return {
expr: Option<Idx<Expr>>,
},
Become {
expr: Idx<Expr>,
},
Yield {
expr: Option<Idx<Expr>>,
},
Yeet {
expr: Option<Idx<Expr>>,
},
RecordLit {
path: Path,
fields: ThinVec<RecordLitField>,
spread: RecordSpread,
},
Field {
expr: Idx<Expr>,
name: Name,
},
Await {
expr: Idx<Expr>,
},
Cast {
expr: Idx<Expr>,
type_ref: Idx<TypeRef>,
},
Ref {
expr: Idx<Expr>,
rawness: Rawness,
mutability: Mutability,
},
Box {
expr: Idx<Expr>,
},
UnaryOp {
expr: Idx<Expr>,
op: UnaryOp,
},
BinaryOp {
lhs: Idx<Expr>,
rhs: Idx<Expr>,
op: Option<BinaryOp>,
},
Assignment {
target: Idx<Pat>,
value: Idx<Expr>,
},
Range {
lhs: Option<Idx<Expr>>,
rhs: Option<Idx<Expr>>,
range_type: RangeOp,
},
Index {
base: Idx<Expr>,
index: Idx<Expr>,
},
Closure {
args: Box<[Idx<Pat>]>,
arg_types: Box<[Option<Idx<TypeRef>>]>,
ret_type: Option<Idx<TypeRef>>,
body: Idx<Expr>,
closure_kind: ClosureKind,
capture_by: CaptureBy,
},
Tuple {
exprs: Box<[Idx<Expr>]>,
},
Array(Array),
Literal(Literal),
Underscore,
OffsetOf(OffsetOf),
InlineAsm(InlineAsm),
IncludeBytes,
}Variants§
Missing
This is produced if the syntax tree does not have a required expression piece.
Path(Path)
If
Let
Block
Fields
Const(Idx<Expr>)
Unsafe
Loop
Call
MethodCall
Fields
Match
Continue
Break
Return
Become
Yield
Yeet
RecordLit
Field
Await
Cast
Ref
Box
UnaryOp
BinaryOp
op cannot be bare = (but can be op=), these are lowered to Assignment instead.
Assignment
Range
Index
Closure
Tuple
Array(Array)
Literal(Literal)
Underscore
OffsetOf(OffsetOf)
InlineAsm(InlineAsm)
IncludeBytes
Implementations§
§impl Expr
impl Expr
pub fn precedence(&self) -> ExprPrecedence
Trait Implementations§
impl Eq for Expr
impl StructuralPartialEq for Expr
Auto Trait Implementations§
impl Freeze for Expr
impl RefUnwindSafe for Expr
impl Send for Expr
impl Sync for Expr
impl Unpin for Expr
impl UnsafeUnpin for Expr
impl UnwindSafe for Expr
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<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
§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<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> 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