#[non_exhaustive]pub enum Expr {
Show 30 variants
Path(Path),
Assign(ExprAssign),
While(ExprWhile),
Loop(ExprLoop),
For(ExprFor),
Let(ExprLet),
If(ExprIf),
Match(ExprMatch),
Call(ExprCall),
FieldAccess(ExprFieldAccess),
Binary(ExprBinary),
Unary(ExprUnary),
Index(ExprIndex),
Break(ExprBreak),
Continue(ExprContinue),
Yield(ExprYield),
Block(ExprBlock),
Return(ExprReturn),
Await(ExprAwait),
Try(ExprTry),
Select(ExprSelect),
Closure(ExprClosure),
Lit(ExprLit),
Object(ExprObject),
Tuple(ExprTuple),
Vec(ExprVec),
Range(ExprRange),
Empty(ExprEmpty),
Group(ExprGroup),
MacroCall(MacroCall),
}
Expand description
A rune expression.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Path(Path)
An path expression.
Assign(ExprAssign)
An assign expression.
While(ExprWhile)
A while loop.
Loop(ExprLoop)
An unconditional loop.
For(ExprFor)
An for loop.
Let(ExprLet)
A let expression.
If(ExprIf)
An if expression.
Match(ExprMatch)
An match expression.
Call(ExprCall)
A function call,
FieldAccess(ExprFieldAccess)
A field access on an expression.
Binary(ExprBinary)
A binary expression.
Unary(ExprUnary)
A unary expression.
Index(ExprIndex)
An index set operation.
Break(ExprBreak)
A break expression.
Continue(ExprContinue)
A continue expression.
Yield(ExprYield)
A yield expression.
Block(ExprBlock)
A block as an expression.
Return(ExprReturn)
A return statement.
Await(ExprAwait)
An await expression.
Try(ExprTry)
Try expression.
Select(ExprSelect)
A select expression.
Closure(ExprClosure)
A closure expression.
Lit(ExprLit)
A literal expression.
Object(ExprObject)
An object literal
Tuple(ExprTuple)
A tuple literal
Vec(ExprVec)
A vec literal
Range(ExprRange)
A range expression.
Empty(ExprEmpty)
A grouped empty expression.
Group(ExprGroup)
A grouped expression.
MacroCall(MacroCall)
A macro call,
Trait Implementations§
Source§impl OptionSpanned for Expr
impl OptionSpanned for Expr
Source§fn option_span(&self) -> Option<Span>
fn option_span(&self) -> Option<Span>
Get the optional span of the type.
Source§impl ToTokens for Expr
impl ToTokens for Expr
Source§fn to_tokens(
&self,
context: &mut MacroContext<'_, '_, '_>,
stream: &mut TokenStream,
) -> Result<()>
fn to_tokens( &self, context: &mut MacroContext<'_, '_, '_>, stream: &mut TokenStream, ) -> Result<()>
Turn the current item into tokens.
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 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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.