#[non_exhaustive]pub enum Stmt {
Local(Box<Local>),
Item(Item, Option<SemiColon>),
Expr(Expr),
Semi(StmtSemi),
}Expand description
A statement within a block.
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.
Local(Box<Local>)
A local declaration.
Item(Item, Option<SemiColon>)
A declaration.
Expr(Expr)
An expression.
Semi(StmtSemi)
An with a trailing semi-colon.
And absent semicolon indicates that it is synthetic.
Trait Implementations§
impl Eq for Stmt
Source§impl OptionSpanned for Stmt
impl OptionSpanned for Stmt
Source§fn option_span(&self) -> Option<Span>
fn option_span(&self) -> Option<Span>
Get the optional span of the type.
impl StructuralPartialEq for Stmt
Auto Trait Implementations§
impl Forget for Stmt
impl Freeze for Stmtwhere
*const Local is !null: Freeze,
PhantomData<Local>: Freeze,
*const Attribute is !null: Freeze,
PhantomData<Attribute>: Freeze,
*const (PathSegmentExpr, Option<Comma>) is !null: Freeze,
PhantomData<(PathSegmentExpr, Option<Comma>)>: Freeze,
*const (ColonColon, PathSegment) is !null: Freeze,
PhantomData<(ColonColon, PathSegment)>: Freeze,
*const (ItemUsePath, Option<Comma>) is !null: Freeze,
PhantomData<(ItemUsePath, Option<Comma>)>: Freeze,
*const (ColonColon, ItemUseSegment) is !null: Freeze,
PhantomData<(ColonColon, ItemUseSegment)>: Freeze,
*const (FnArg, Option<Comma>) is !null: Freeze,
PhantomData<(FnArg, Option<Comma>)>: Freeze,
*const (Box<Type>, Option<Comma>) is !null: Freeze,
PhantomData<(Box<Type>, Option<Comma>)>: Freeze,
*const Stmt is !null: Freeze,
PhantomData<Stmt>: Freeze,
*const (ItemVariant, Option<Comma>) is !null: Freeze,
PhantomData<(ItemVariant, Option<Comma>)>: Freeze,
*const (Field, Option<Comma>) is !null: Freeze,
PhantomData<(Field, Option<Comma>)>: Freeze,
*const (ImplItem, Option<SemiColon>) is !null: Freeze,
PhantomData<(ImplItem, Option<SemiColon>)>: Freeze,
*const File is !null: Freeze,
PhantomData<File>: Freeze,
*const Expr is !null: Freeze,
PhantomData<Expr>: Freeze,
*const Condition is !null: Freeze,
PhantomData<Condition>: Freeze,
*const Block is !null: Freeze,
PhantomData<Block>: Freeze,
*const (Pat, Option<Comma>) is !null: Freeze,
PhantomData<(Pat, Option<Comma>)>: Freeze,
*const Pat is !null: Freeze,
PhantomData<Pat>: Freeze,
*const ExprElseIf is !null: Freeze,
PhantomData<ExprElseIf>: Freeze,
*const (ExprMatchBranch, Option<Comma>) is !null: Freeze,
PhantomData<(ExprMatchBranch, Option<Comma>)>: Freeze,
*const (Expr, Option<Comma>) is !null: Freeze,
PhantomData<(Expr, Option<Comma>)>: Freeze,
*const (ExprSelectBranch, Option<Comma>) is !null: Freeze,
PhantomData<(ExprSelectBranch, Option<Comma>)>: Freeze,
*const (FieldAssign, Option<Comma>) is !null: Freeze,
PhantomData<(FieldAssign, Option<Comma>)>: Freeze,
NonZero<u32>: Freeze,
*const Token is !null: Freeze,
PhantomData<Token>: Freeze,
impl Move for Stmt
impl RefUnwindSafe for Stmt
impl Send for Stmtwhere
Unique<Local>: Send,
Unique<Attribute>: Send,
Unique<(PathSegmentExpr, Option<Comma>)>: Send,
Unique<(ColonColon, PathSegment)>: Send,
Unique<(ItemUsePath, Option<Comma>)>: Send,
Unique<(ColonColon, ItemUseSegment)>: Send,
Unique<(FnArg, Option<Comma>)>: Send,
Unique<(Box<Type>, Option<Comma>)>: Send,
Unique<Stmt>: Send,
Unique<(ItemVariant, Option<Comma>)>: Send,
Unique<(Field, Option<Comma>)>: Send,
Unique<(ImplItem, Option<SemiColon>)>: Send,
Unique<File>: Send,
Unique<Expr>: Send,
Unique<Condition>: Send,
Unique<Block>: Send,
Unique<(Pat, Option<Comma>)>: Send,
Unique<Pat>: Send,
Unique<ExprElseIf>: Send,
Unique<(ExprMatchBranch, Option<Comma>)>: Send,
Unique<(Expr, Option<Comma>)>: Send,
Unique<(ExprSelectBranch, Option<Comma>)>: Send,
Unique<(FieldAssign, Option<Comma>)>: Send,
NonZero<u32>: Send,
Unique<Token>: Send,
impl Sync for Stmtwhere
Unique<Local>: Sync,
Unique<Attribute>: Sync,
Unique<(PathSegmentExpr, Option<Comma>)>: Sync,
Unique<(ColonColon, PathSegment)>: Sync,
Unique<(ItemUsePath, Option<Comma>)>: Sync,
Unique<(ColonColon, ItemUseSegment)>: Sync,
Unique<(FnArg, Option<Comma>)>: Sync,
Unique<(Box<Type>, Option<Comma>)>: Sync,
Unique<Stmt>: Sync,
Unique<(ItemVariant, Option<Comma>)>: Sync,
Unique<(Field, Option<Comma>)>: Sync,
Unique<(ImplItem, Option<SemiColon>)>: Sync,
Unique<File>: Sync,
Unique<Expr>: Sync,
Unique<Condition>: Sync,
Unique<Block>: Sync,
Unique<(Pat, Option<Comma>)>: Sync,
Unique<Pat>: Sync,
Unique<ExprElseIf>: Sync,
Unique<(ExprMatchBranch, Option<Comma>)>: Sync,
Unique<(Expr, Option<Comma>)>: Sync,
Unique<(ExprSelectBranch, Option<Comma>)>: Sync,
Unique<(FieldAssign, Option<Comma>)>: Sync,
NonZero<u32>: Sync,
Unique<Token>: Sync,
impl Unpin for Stmtwhere
Box<Local>: Unpin,
*const Attribute is !null: Unpin,
*const (PathSegmentExpr, Option<Comma>) is !null: Unpin,
Box<Expr>: Unpin,
Box<Condition>: Unpin,
Box<Block>: Unpin,
*const (Pat, Option<Comma>) is !null: Unpin,
Box<Pat>: Unpin,
*const ExprElseIf is !null: Unpin,
*const (ExprMatchBranch, Option<Comma>) is !null: Unpin,
*const (Expr, Option<Comma>) is !null: Unpin,
*const Stmt is !null: Unpin,
*const (ExprSelectBranch, Option<Comma>) is !null: Unpin,
*const (FnArg, Option<Comma>) is !null: Unpin,
*const (FieldAssign, Option<Comma>) is !null: Unpin,
NonZero<u32>: Unpin,
*const Token is !null: Unpin,
*const (ColonColon, PathSegment) is !null: Unpin,
*const (ItemUsePath, Option<Comma>) is !null: Unpin,
*const (ColonColon, ItemUseSegment) is !null: Unpin,
*const (Box<Type>, Option<Comma>) is !null: Unpin,
Box<Type>: Unpin,
*const (ItemVariant, Option<Comma>) is !null: Unpin,
*const (Field, Option<Comma>) is !null: Unpin,
*const (ImplItem, Option<SemiColon>) is !null: Unpin,
Box<File>: Unpin,
impl UnsafeUnpin for Stmtwhere
*const Local is !null: UnsafeUnpin,
PhantomData<Local>: UnsafeUnpin,
*const Attribute is !null: UnsafeUnpin,
PhantomData<Attribute>: UnsafeUnpin,
*const (PathSegmentExpr, Option<Comma>) is !null: UnsafeUnpin,
PhantomData<(PathSegmentExpr, Option<Comma>)>: UnsafeUnpin,
*const (ColonColon, PathSegment) is !null: UnsafeUnpin,
PhantomData<(ColonColon, PathSegment)>: UnsafeUnpin,
*const (ItemUsePath, Option<Comma>) is !null: UnsafeUnpin,
PhantomData<(ItemUsePath, Option<Comma>)>: UnsafeUnpin,
*const (ColonColon, ItemUseSegment) is !null: UnsafeUnpin,
PhantomData<(ColonColon, ItemUseSegment)>: UnsafeUnpin,
*const (FnArg, Option<Comma>) is !null: UnsafeUnpin,
PhantomData<(FnArg, Option<Comma>)>: UnsafeUnpin,
*const (Box<Type>, Option<Comma>) is !null: UnsafeUnpin,
PhantomData<(Box<Type>, Option<Comma>)>: UnsafeUnpin,
*const Stmt is !null: UnsafeUnpin,
PhantomData<Stmt>: UnsafeUnpin,
*const (ItemVariant, Option<Comma>) is !null: UnsafeUnpin,
PhantomData<(ItemVariant, Option<Comma>)>: UnsafeUnpin,
*const (Field, Option<Comma>) is !null: UnsafeUnpin,
PhantomData<(Field, Option<Comma>)>: UnsafeUnpin,
*const (ImplItem, Option<SemiColon>) is !null: UnsafeUnpin,
PhantomData<(ImplItem, Option<SemiColon>)>: UnsafeUnpin,
*const File is !null: UnsafeUnpin,
PhantomData<File>: UnsafeUnpin,
*const Expr is !null: UnsafeUnpin,
PhantomData<Expr>: UnsafeUnpin,
*const Condition is !null: UnsafeUnpin,
PhantomData<Condition>: UnsafeUnpin,
*const Block is !null: UnsafeUnpin,
PhantomData<Block>: UnsafeUnpin,
*const (Pat, Option<Comma>) is !null: UnsafeUnpin,
PhantomData<(Pat, Option<Comma>)>: UnsafeUnpin,
*const Pat is !null: UnsafeUnpin,
PhantomData<Pat>: UnsafeUnpin,
*const ExprElseIf is !null: UnsafeUnpin,
PhantomData<ExprElseIf>: UnsafeUnpin,
*const (ExprMatchBranch, Option<Comma>) is !null: UnsafeUnpin,
PhantomData<(ExprMatchBranch, Option<Comma>)>: UnsafeUnpin,
*const (Expr, Option<Comma>) is !null: UnsafeUnpin,
PhantomData<(Expr, Option<Comma>)>: UnsafeUnpin,
*const (ExprSelectBranch, Option<Comma>) is !null: UnsafeUnpin,
PhantomData<(ExprSelectBranch, Option<Comma>)>: UnsafeUnpin,
*const (FieldAssign, Option<Comma>) is !null: UnsafeUnpin,
PhantomData<(FieldAssign, Option<Comma>)>: UnsafeUnpin,
NonZeroU32Inner: UnsafeUnpin,
*const Token is !null: UnsafeUnpin,
PhantomData<Token>: UnsafeUnpin,
impl UnwindSafe for Stmtwhere
NonNull<Local>: UnwindSafe,
NonNull<Attribute>: UnwindSafe,
NonNull<(PathSegmentExpr, Option<Comma>)>: UnwindSafe,
NonNull<Expr>: UnwindSafe,
NonNull<Condition>: UnwindSafe,
NonNull<(Pat, Option<Comma>)>: UnwindSafe,
NonNull<Pat>: UnwindSafe,
NonNull<Block>: UnwindSafe,
NonNull<Stmt>: UnwindSafe,
NonNull<ExprElseIf>: UnwindSafe,
NonNull<(ExprMatchBranch, Option<Comma>)>: UnwindSafe,
NonNull<(Expr, Option<Comma>)>: UnwindSafe,
NonNull<(ExprSelectBranch, Option<Comma>)>: UnwindSafe,
NonNull<(FnArg, Option<Comma>)>: UnwindSafe,
NonNull<(FieldAssign, Option<Comma>)>: UnwindSafe,
NonZero<u32>: UnwindSafe,
NonNull<Token>: UnwindSafe,
NonNull<(ColonColon, PathSegment)>: UnwindSafe,
NonNull<(ItemUsePath, Option<Comma>)>: UnwindSafe,
NonNull<(ColonColon, ItemUseSegment)>: UnwindSafe,
NonNull<(Box<Type>, Option<Comma>)>: UnwindSafe,
NonNull<Type>: UnwindSafe,
NonNull<(ItemVariant, Option<Comma>)>: UnwindSafe,
NonNull<(Field, Option<Comma>)>: UnwindSafe,
NonNull<(ImplItem, Option<SemiColon>)>: UnwindSafe,
NonNull<File>: UnwindSafe,
NonNull<(Item, Option<SemiColon>)>: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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.