pub struct SwitchCase { /* private fields */ }Expand description
One arm of a switch statement.
Implementations§
Source§impl SwitchCase
impl SwitchCase
Sourcepub fn new(test: Option<Expression>, consequent: Vec<Statement>) -> Self
pub fn new(test: Option<Expression>, consequent: Vec<Statement>) -> Self
Build a case. test = None is the default: arm.
Sourcepub fn test(&self) -> Option<&Expression>
pub fn test(&self) -> Option<&Expression>
The case label expression, or None for default:.
Sourcepub fn consequent(&self) -> &[Statement] ⓘ
pub fn consequent(&self) -> &[Statement] ⓘ
The statements that run when this case is selected.
Trait Implementations§
Source§impl Clone for SwitchCase
impl Clone for SwitchCase
Source§fn clone(&self) -> SwitchCase
fn clone(&self) -> SwitchCase
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 SwitchCase
impl Debug for SwitchCase
impl Eq for SwitchCase
Source§impl PartialEq for SwitchCase
impl PartialEq for SwitchCase
impl StructuralPartialEq for SwitchCase
Auto Trait Implementations§
impl Freeze for SwitchCase
impl RefUnwindSafe for SwitchCase
impl Send for SwitchCase
impl Sync for SwitchCase
impl Unpin for SwitchCase
impl UnsafeUnpin for SwitchCase
impl UnwindSafe for SwitchCase
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