#[non_exhaustive]pub struct BranchShell {
pub keyword: BranchKeyword,
pub condition_range: SourceLocation,
pub elsif_count: usize,
pub has_else: bool,
}Expand description
Conditional-branch shell payload.
Models the static shape of an if/unless block statement or a ternary
expression: how many alternatives exist and whether a fallthrough else
arm is present. It is provider-neutral substrate proof, not an evaluator.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.keyword: BranchKeywordSurface form that produced this branch.
condition_range: SourceLocationSource range of the primary condition expression.
elsif_count: usizeNumber of elsif alternatives (block form only; 0 for ternary).
has_else: boolWhether a fallthrough else arm (or ternary else expression) exists.
Trait Implementations§
Source§impl Clone for BranchShell
impl Clone for BranchShell
Source§fn clone(&self) -> BranchShell
fn clone(&self) -> BranchShell
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 BranchShell
impl Debug for BranchShell
impl Eq for BranchShell
Source§impl PartialEq for BranchShell
impl PartialEq for BranchShell
Source§fn eq(&self, other: &BranchShell) -> bool
fn eq(&self, other: &BranchShell) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for BranchShell
Auto Trait Implementations§
impl Freeze for BranchShell
impl RefUnwindSafe for BranchShell
impl Send for BranchShell
impl Sync for BranchShell
impl Unpin for BranchShell
impl UnsafeUnpin for BranchShell
impl UnwindSafe for BranchShell
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