pub struct If {
pub if_token: Token,
pub condition: Box<Expr>,
pub then_block: Block,
pub else_ifs: Vec<ElseBlock>,
pub else_block: Option<ElseBlock>,
}Expand description
Represents an if statement in the AST.
An if statement includes a condition, a then block, and optional else if and else blocks.
Fields§
§if_token: TokenThe token representing the if keyword.
condition: Box<Expr>The condition expression to evaluate.
then_block: BlockThe block of code to execute if the condition is true.
else_ifs: Vec<ElseBlock>A list of else if blocks.
else_block: Option<ElseBlock>An optional else block.
Trait Implementations§
impl StructuralPartialEq for If
Auto Trait Implementations§
impl Freeze for If
impl RefUnwindSafe for If
impl Send for If
impl Sync for If
impl Unpin for If
impl UnwindSafe for If
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