Struct valkyrie_ast::IfStatement
source · pub struct IfStatement {
pub branches: Vec<IfBranchNode>,
pub else_body: Option<ElseStatement>,
pub span: Range<u32>,
}Expand description
if a {1} else if b {2} else if c {3} else {4}
Fields§
§branches: Vec<IfBranchNode>The case branches to check
else_body: Option<ElseStatement>The default branch if all cases fail
span: Range<u32>The range of the node
Implementations§
source§impl IfStatement
impl IfStatement
sourcepub fn as_switch(&self) -> SwitchStatement
pub fn as_switch(&self) -> SwitchStatement
Make the if statement into equivalent switch statement
Trait Implementations§
source§impl Clone for IfStatement
impl Clone for IfStatement
source§fn clone(&self) -> IfStatement
fn clone(&self) -> IfStatement
Returns a copy 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 IfStatement
impl Debug for IfStatement
source§impl From<IfStatement> for ExpressionKind
impl From<IfStatement> for ExpressionKind
source§fn from(o: IfStatement) -> Self
fn from(o: IfStatement) -> Self
Converts to this type from the input type.
source§impl Hash for IfStatement
impl Hash for IfStatement
source§impl PartialEq for IfStatement
impl PartialEq for IfStatement
source§fn eq(&self, other: &IfStatement) -> bool
fn eq(&self, other: &IfStatement) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl ValkyrieNode for IfStatement
impl ValkyrieNode for IfStatement
impl Eq for IfStatement
impl StructuralPartialEq for IfStatement
Auto Trait Implementations§
impl RefUnwindSafe for IfStatement
impl Send for IfStatement
impl Sync for IfStatement
impl Unpin for IfStatement
impl UnwindSafe for IfStatement
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