pub struct MatchStatement { /* private fields */ }Expand description
A match statement.
Implementations§
Source§impl MatchStatement
Assignment
impl MatchStatement
Assignment
Sourcepub fn assignment(&self) -> Option<&Var>
pub fn assignment(&self) -> Option<&Var>
Gets the optional variable name assignment.
Sourcepub fn set_assignment<V>(&mut self, assignment: V)
pub fn set_assignment<V>(&mut self, assignment: V)
Sets the variable name assignment.
Sourcepub fn with_assignment<V>(self, assignment: V) -> Self
pub fn with_assignment<V>(self, assignment: V) -> Self
Sets the variable name assignment.
Source§impl MatchStatement
Cases
impl MatchStatement
Cases
Sourcepub fn add_match_case(&mut self, case: MatchCase)
pub fn add_match_case(&mut self, case: MatchCase)
Adds the match case.
Sourcepub fn with_match_case(self, case: MatchCase) -> Self
pub fn with_match_case(self, case: MatchCase) -> Self
Adds the match case.
Trait Implementations§
Source§impl From<&str> for MatchStatement
impl From<&str> for MatchStatement
Source§impl<E: 'static + Expression> From<E> for MatchStatement
impl<E: 'static + Expression> From<E> for MatchStatement
Source§impl From<String> for MatchStatement
impl From<String> for MatchStatement
Source§impl Statement for MatchStatement
impl Statement for MatchStatement
Source§fn write(&self, b: &mut CodeBuffer, level: usize)
fn write(&self, b: &mut CodeBuffer, level: usize)
Writes the code to the buffer
b at the indent level.Auto Trait Implementations§
impl Freeze for MatchStatement
impl !RefUnwindSafe for MatchStatement
impl !Send for MatchStatement
impl !Sync for MatchStatement
impl Unpin for MatchStatement
impl !UnwindSafe for MatchStatement
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