pub struct ThenElse {
pub condition: Box<Expr>,
pub then_expr: Box<Expr>,
pub else_expr: Box<Expr>,
pub then_token: Token,
pub else_token: Token,
}Expand description
Represents a then-else expression in the AST.
A then-else expression is used to conditionally evaluate one of two expressions.
§Examples
let value = if condition then 42 else 0Fields§
§condition: Box<Expr>The condition expression.
then_expr: Box<Expr>The expression to evaluate if the condition is true.
else_expr: Box<Expr>The expression to evaluate if the condition is false.
then_token: TokenThe token representing the then keyword.
else_token: TokenThe token representing the else keyword.
Trait Implementations§
impl StructuralPartialEq for ThenElse
Auto Trait Implementations§
impl Freeze for ThenElse
impl RefUnwindSafe for ThenElse
impl Send for ThenElse
impl Sync for ThenElse
impl Unpin for ThenElse
impl UnwindSafe for ThenElse
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