pub struct If {
pub condition: Box<Expr>,
pub then_expr: Box<Expr>,
pub else_expr: Option<Box<Expr>>,
pub span: Range<usize>,
pub if_span: Range<usize>,
pub else_span: Option<Range<usize>>,
}Expand description
An if expression, such as if true 1 else 2.
Fields§
§condition: Box<Expr>The condition of the if expression.
then_expr: Box<Expr>The expression to evaluate if the condition is true.
else_expr: Option<Box<Expr>>The expression to evaluate if the condition is false.
span: Range<usize>The region of the source code that this literal was parsed from.
if_span: Range<usize>The span of the if keyword.
else_span: Option<Range<usize>>The span of the else keyword.
Implementations§
Trait Implementations§
Source§impl Latex for If
impl Latex for If
Source§fn as_display(&self) -> LatexFormatter<'_, Self>
fn as_display(&self) -> LatexFormatter<'_, Self>
Wraps the value in a
LatexFormatter, which implements Display.Source§impl<'source> Parse<'source> for If
impl<'source> Parse<'source> for If
impl Eq for If
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