#[non_exhaustive]pub struct IfStmt {
pub condition: Expr,
pub then_branch: Box<Stmt>,
pub elseif_branches: Box<[ElseIfBranch]>,
pub else_branch: Option<Box<Stmt>>,
pub uses_alternative: bool,
/* private fields */
}Expand description
An if 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.condition: ExprThe if condition.
then_branch: Box<Stmt>Statement run when the condition holds.
elseif_branches: Box<[ElseIfBranch]>elseif branches in source order.
else_branch: Option<Box<Stmt>>The else statement, if any.
uses_alternative: boolWhether the if: ... endif; syntax is used.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for IfStmt
impl RefUnwindSafe for IfStmt
impl Send for IfStmt
impl Sync for IfStmt
impl Unpin for IfStmt
impl UnsafeUnpin for IfStmt
impl UnwindSafe for IfStmt
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