pub struct SwitchStatement {
pub condition: Expression,
pub condition_location: SourceLocation,
pub cases: Vec<SwitchCase>,
pub location: SourceLocation,
}Fields§
§condition: Expression§condition_location: SourceLocation§cases: Vec<SwitchCase>Cases with their associated statement bodies
location: SourceLocationImplementations§
Source§impl SwitchStatement
impl SwitchStatement
Sourcepub fn case_identifiers(&self) -> Vec<&str>
pub fn case_identifiers(&self) -> Vec<&str>
Extract identifiers from non-default case labels Returns vector of case value identifier names (e.g., [“PROP_NAME”, “PROP_TITLE”])
Sourcepub fn has_default_case(&self) -> bool
pub fn has_default_case(&self) -> bool
Check if switch has a default case
Sourcepub fn all_statements(&self) -> impl Iterator<Item = &Statement>
pub fn all_statements(&self) -> impl Iterator<Item = &Statement>
Get all statements across all case bodies (flattened view)
Sourcepub fn default_case(&self) -> Option<&SwitchCase>
pub fn default_case(&self) -> Option<&SwitchCase>
Find the default case if it exists
Trait Implementations§
Source§impl Clone for SwitchStatement
impl Clone for SwitchStatement
Source§impl Debug for SwitchStatement
impl Debug for SwitchStatement
Auto Trait Implementations§
impl Freeze for SwitchStatement
impl RefUnwindSafe for SwitchStatement
impl Send for SwitchStatement
impl Sync for SwitchStatement
impl Unpin for SwitchStatement
impl UnsafeUnpin for SwitchStatement
impl UnwindSafe for SwitchStatement
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