pub struct IfExpression {
pub if_keyword: Token,
pub condition: Pointer<Expression>,
pub then_keyword: Token,
pub if_expression: Pointer<Expression>,
pub else_if_expressions: Pointer<Vec<ElseIfExpression>>,
pub else_keyword: Token,
pub else_expression: Pointer<Expression>,
}Expand description
A struct representing an elseif expression, only exists in variable declarations.
Fields§
§if_keyword: TokenThe if keyword.
condition: Pointer<Expression>The condition after the if keyword.
then_keyword: TokenThe then keyword after the condition.
if_expression: Pointer<Expression>The expression that this statement would resolve to if the
condition evaluated to true.
else_if_expressions: Pointer<Vec<ElseIfExpression>>All elseif expressions.
else_keyword: TokenThe final part of the expression, the else keyword.
else_expression: Pointer<Expression>The final value if all other conditions were not met.
Trait Implementations§
Source§impl Clone for IfExpression
impl Clone for IfExpression
Source§fn clone(&self) -> IfExpression
fn clone(&self) -> IfExpression
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for IfExpression
impl Debug for IfExpression
Source§impl GetRange for IfExpression
impl GetRange for IfExpression
Source§impl Hash for IfExpression
impl Hash for IfExpression
Source§impl Ord for IfExpression
impl Ord for IfExpression
Source§fn cmp(&self, other: &IfExpression) -> Ordering
fn cmp(&self, other: &IfExpression) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl Parse for IfExpression
impl Parse for IfExpression
Source§impl PartialEq for IfExpression
impl PartialEq for IfExpression
Source§impl PartialOrd for IfExpression
impl PartialOrd for IfExpression
Source§impl Print for IfExpression
impl Print for IfExpression
Source§fn print_final_trivia(&self) -> String
fn print_final_trivia(&self) -> String
Prints only the very final trivia. Used for the default implementation of
Print::print, which just joins Print::print_without_final_trivia
and this function.Source§fn print_without_final_trivia(&self) -> String
fn print_without_final_trivia(&self) -> String
Prints the whole token including all surrounding trivia, excluding the
very last trailing trivia.
Source§impl TryParse for IfExpression
impl TryParse for IfExpression
impl Eq for IfExpression
impl StructuralPartialEq for IfExpression
Auto Trait Implementations§
impl Freeze for IfExpression
impl RefUnwindSafe for IfExpression
impl !Send for IfExpression
impl !Sync for IfExpression
impl Unpin for IfExpression
impl UnwindSafe for IfExpression
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