pub struct SwitchStmt<'a> {
pub keyword: Slice<'a>,
pub open_paren: Slice<'a>,
pub discriminant: Expr<'a>,
pub close_paren: Slice<'a>,
pub open_brace: Slice<'a>,
pub cases: Vec<SwitchCase<'a>>,
pub close_brace: Slice<'a>,
}
Expand description
A switch statement
switch (Math.floor(Math.random()) * 10) {
case 1:
break;
case 2:
case 3:
case 4:
return false;
default:
return true;
}
Fields
keyword: Slice<'a>
open_paren: Slice<'a>
discriminant: Expr<'a>
close_paren: Slice<'a>
open_brace: Slice<'a>
cases: Vec<SwitchCase<'a>>
close_brace: Slice<'a>
Trait Implementations
sourceimpl<'a> Clone for SwitchStmt<'a>
impl<'a> Clone for SwitchStmt<'a>
sourcefn clone(&self) -> SwitchStmt<'a>
fn clone(&self) -> SwitchStmt<'a>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<'a> Debug for SwitchStmt<'a>
impl<'a> Debug for SwitchStmt<'a>
sourceimpl<'a> From<SwitchStmt<'a>> for SwitchStmt<'a>
impl<'a> From<SwitchStmt<'a>> for SwitchStmt<'a>
sourcefn from(other: SwitchStmt<'a>) -> Self
fn from(other: SwitchStmt<'a>) -> Self
Converts to this type from the input type.
sourceimpl<'a> Node for SwitchStmt<'a>
impl<'a> Node for SwitchStmt<'a>
fn loc(&self) -> SourceLocation
sourceimpl<'a> PartialEq<SwitchStmt<'a>> for SwitchStmt<'a>
impl<'a> PartialEq<SwitchStmt<'a>> for SwitchStmt<'a>
sourcefn eq(&self, other: &SwitchStmt<'a>) -> bool
fn eq(&self, other: &SwitchStmt<'a>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
impl<'a> StructuralPartialEq for SwitchStmt<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for SwitchStmt<'a>
impl<'a> Send for SwitchStmt<'a>
impl<'a> Sync for SwitchStmt<'a>
impl<'a> Unpin for SwitchStmt<'a>
impl<'a> UnwindSafe for SwitchStmt<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more