pub struct Switch { /* private fields */ }
Expand description
The switch
statement evaluates an expression, matching the expression’s value to a case
clause, and executes statements associated with that case, as well as statements in cases
that follow the matching case.
A switch
statement first evaluates its expression. It then looks for the first case
clause whose expression evaluates to the same value as the result of the input expression
(using the strict comparison, ===
) and transfers control to that clause, executing the
associated statements. (If multiple cases match the provided value, the first case that
matches is selected, even if the cases are not equal to each other.)
More information:
Implementations§
Trait Implementations§
Source§impl Executable for Switch
impl Executable for Switch
Source§impl Trace for Switch
impl Trace for Switch
Source§fn finalize_glue(&self)
fn finalize_glue(&self)
Runs Finalize::finalize() on this object and all
contained subobjects
impl StructuralPartialEq for Switch
Auto Trait Implementations§
impl Freeze for Switch
impl RefUnwindSafe for Switch
impl !Send for Switch
impl !Sync for Switch
impl Unpin for Switch
impl UnwindSafe for Switch
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