pub struct If<'a> {
pub test: Expression<'a>,
pub body: Suite<'a>,
pub orelse: Option<Box<OrElse<'a>>>,
pub leading_lines: Vec<EmptyLine<'a>>,
pub whitespace_before_test: SimpleWhitespace<'a>,
pub whitespace_after_test: SimpleWhitespace<'a>,
pub is_elif: bool,
}
Fields§
§test: Expression<'a>
The expression that, when evaluated, should give us a truthy value
body: Suite<'a>
§orelse: Option<Box<OrElse<'a>>>
An optional elif
or else
clause. If
signifies an elif
block.
leading_lines: Vec<EmptyLine<'a>>
Sequence of empty lines appearing before this compound statement line.
whitespace_before_test: SimpleWhitespace<'a>
The whitespace appearing after the if
keyword but before the test
expression.
whitespace_after_test: SimpleWhitespace<'a>
The whitespace appearing after the test expression but before the colon.
is_elif: bool
Signifies if this instance represents an elif
or an if
block.
Trait Implementations§
impl<'a> Eq for If<'a>
impl<'a> StructuralPartialEq for If<'a>
Auto Trait Implementations§
impl<'a> Freeze for If<'a>
impl<'a> RefUnwindSafe for If<'a>
impl<'a> Send for If<'a>
impl<'a> Sync for If<'a>
impl<'a> Unpin for If<'a>
impl<'a> UnwindSafe for If<'a>
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