pub struct IfStmt {
pub condition: Expr,
pub then_block: Block,
pub else_branch: Option<ElseBranch>,
}Expand description
If statement: if cond { ... } else { ... }
See also ExprKind::IfExpr for the expression form.
Fields§
§condition: ExprCondition expression (must evaluate to bool).
then_block: BlockThen-branch block.
else_branch: Option<ElseBranch>Optional else or else-if branch.
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