#[non_exhaustive]pub struct SwitchStmt<'arena, 'src> {
pub expr: Expr<'arena, 'src>,
pub body: SwitchBody<'arena, 'src>,
pub uses_alternative: bool,
}Expand description
A switch statement.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.expr: Expr<'arena, 'src>Subject expression.
body: SwitchBody<'arena, 'src>Case list, flattened on serialization.
uses_alternative: booltrue when written in alternative syntax (: ... endX;).
Implementations§
Source§impl<'arena, 'src> SwitchStmt<'arena, 'src>
impl<'arena, 'src> SwitchStmt<'arena, 'src>
Sourcepub fn new(expr: Expr<'arena, 'src>, body: SwitchBody<'arena, 'src>) -> Self
pub fn new(expr: Expr<'arena, 'src>, body: SwitchBody<'arena, 'src>) -> Self
Builds a SwitchStmt from its identifying fields with every other field empty. Set
the rest by assignment, as with Param::new.
Trait Implementations§
Source§impl<'arena, 'src> Debug for SwitchStmt<'arena, 'src>
impl<'arena, 'src> Debug for SwitchStmt<'arena, 'src>
Auto Trait Implementations§
impl<'arena, 'src> !RefUnwindSafe for SwitchStmt<'arena, 'src>
impl<'arena, 'src> !Send for SwitchStmt<'arena, 'src>
impl<'arena, 'src> !Sync for SwitchStmt<'arena, 'src>
impl<'arena, 'src> !UnwindSafe for SwitchStmt<'arena, 'src>
impl<'arena, 'src> Freeze for SwitchStmt<'arena, 'src>
impl<'arena, 'src> Unpin for SwitchStmt<'arena, 'src>
impl<'arena, 'src> UnsafeUnpin for SwitchStmt<'arena, 'src>
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