pub enum Statement {
Show 17 variants
Void,
Compound(CompoundStatement),
Assignment(AssignmentStatement),
Increment(IncrementStatement),
Decrement(DecrementStatement),
If(IfStatement),
Switch(SwitchStatement),
Loop(LoopStatement),
For(ForStatement),
While(WhileStatement),
Break(BreakStatement),
Continue(ContinueStatement),
Return(ReturnStatement),
Discard(DiscardStatement),
FunctionCall(FunctionCallStatement),
ConstAssert(ConstAssertStatement),
Declaration(DeclarationStatement),
}
Variants§
Void
Compound(CompoundStatement)
Assignment(AssignmentStatement)
Increment(IncrementStatement)
Decrement(DecrementStatement)
If(IfStatement)
Switch(SwitchStatement)
Loop(LoopStatement)
For(ForStatement)
While(WhileStatement)
Break(BreakStatement)
Continue(ContinueStatement)
Return(ReturnStatement)
Discard(DiscardStatement)
FunctionCall(FunctionCallStatement)
ConstAssert(ConstAssertStatement)
Declaration(DeclarationStatement)
Implementations§
Source§impl Statement
impl Statement
Sourcepub const fn is_void(&self) -> bool
pub const fn is_void(&self) -> bool
Returns true
if this value is of type Void
. Returns false
otherwise
Sourcepub const fn is_compound(&self) -> bool
pub const fn is_compound(&self) -> bool
Returns true
if this value is of type Compound
. Returns false
otherwise
Sourcepub const fn is_assignment(&self) -> bool
pub const fn is_assignment(&self) -> bool
Returns true
if this value is of type Assignment
. Returns false
otherwise
Sourcepub const fn is_increment(&self) -> bool
pub const fn is_increment(&self) -> bool
Returns true
if this value is of type Increment
. Returns false
otherwise
Sourcepub const fn is_decrement(&self) -> bool
pub const fn is_decrement(&self) -> bool
Returns true
if this value is of type Decrement
. Returns false
otherwise
Sourcepub const fn is_if(&self) -> bool
pub const fn is_if(&self) -> bool
Returns true
if this value is of type If
. Returns false
otherwise
Sourcepub const fn is_switch(&self) -> bool
pub const fn is_switch(&self) -> bool
Returns true
if this value is of type Switch
. Returns false
otherwise
Sourcepub const fn is_loop(&self) -> bool
pub const fn is_loop(&self) -> bool
Returns true
if this value is of type Loop
. Returns false
otherwise
Sourcepub const fn is_for(&self) -> bool
pub const fn is_for(&self) -> bool
Returns true
if this value is of type For
. Returns false
otherwise
Sourcepub const fn is_while(&self) -> bool
pub const fn is_while(&self) -> bool
Returns true
if this value is of type While
. Returns false
otherwise
Sourcepub const fn is_break(&self) -> bool
pub const fn is_break(&self) -> bool
Returns true
if this value is of type Break
. Returns false
otherwise
Sourcepub const fn is_continue(&self) -> bool
pub const fn is_continue(&self) -> bool
Returns true
if this value is of type Continue
. Returns false
otherwise
Sourcepub const fn is_return(&self) -> bool
pub const fn is_return(&self) -> bool
Returns true
if this value is of type Return
. Returns false
otherwise
Sourcepub const fn is_discard(&self) -> bool
pub const fn is_discard(&self) -> bool
Returns true
if this value is of type Discard
. Returns false
otherwise
Sourcepub const fn is_function_call(&self) -> bool
pub const fn is_function_call(&self) -> bool
Returns true
if this value is of type FunctionCall
. Returns false
otherwise
Sourcepub const fn is_const_assert(&self) -> bool
pub const fn is_const_assert(&self) -> bool
Returns true
if this value is of type ConstAssert
. Returns false
otherwise
Sourcepub const fn is_declaration(&self) -> bool
pub const fn is_declaration(&self) -> bool
Returns true
if this value is of type Declaration
. Returns false
otherwise
Source§impl Statement
impl Statement
Sourcepub fn unwrap_void(self)
pub fn unwrap_void(self)
Unwraps this value to the Statement::Void
variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_compound(self) -> CompoundStatement
pub fn unwrap_compound(self) -> CompoundStatement
Unwraps this value to the Statement::Compound
variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_assignment(self) -> AssignmentStatement
pub fn unwrap_assignment(self) -> AssignmentStatement
Unwraps this value to the Statement::Assignment
variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_increment(self) -> IncrementStatement
pub fn unwrap_increment(self) -> IncrementStatement
Unwraps this value to the Statement::Increment
variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_decrement(self) -> DecrementStatement
pub fn unwrap_decrement(self) -> DecrementStatement
Unwraps this value to the Statement::Decrement
variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_if(self) -> IfStatement
pub fn unwrap_if(self) -> IfStatement
Unwraps this value to the Statement::If
variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_switch(self) -> SwitchStatement
pub fn unwrap_switch(self) -> SwitchStatement
Unwraps this value to the Statement::Switch
variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_loop(self) -> LoopStatement
pub fn unwrap_loop(self) -> LoopStatement
Unwraps this value to the Statement::Loop
variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_for(self) -> ForStatement
pub fn unwrap_for(self) -> ForStatement
Unwraps this value to the Statement::For
variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_while(self) -> WhileStatement
pub fn unwrap_while(self) -> WhileStatement
Unwraps this value to the Statement::While
variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_break(self) -> BreakStatement
pub fn unwrap_break(self) -> BreakStatement
Unwraps this value to the Statement::Break
variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_continue(self) -> ContinueStatement
pub fn unwrap_continue(self) -> ContinueStatement
Unwraps this value to the Statement::Continue
variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_return(self) -> ReturnStatement
pub fn unwrap_return(self) -> ReturnStatement
Unwraps this value to the Statement::Return
variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_discard(self) -> DiscardStatement
pub fn unwrap_discard(self) -> DiscardStatement
Unwraps this value to the Statement::Discard
variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_function_call(self) -> FunctionCallStatement
pub fn unwrap_function_call(self) -> FunctionCallStatement
Unwraps this value to the Statement::FunctionCall
variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_const_assert(self) -> ConstAssertStatement
pub fn unwrap_const_assert(self) -> ConstAssertStatement
Unwraps this value to the Statement::ConstAssert
variant.
Panics if this value is of any other type.
Sourcepub fn unwrap_declaration(self) -> DeclarationStatement
pub fn unwrap_declaration(self) -> DeclarationStatement
Unwraps this value to the Statement::Declaration
variant.
Panics if this value is of any other type.
Source§impl Statement
impl Statement
Sourcepub fn remove_voids(&mut self)
pub fn remove_voids(&mut self)
Remove all Statement::Void
Trait Implementations§
Source§impl From<AssignmentStatement> for Statement
impl From<AssignmentStatement> for Statement
Source§fn from(value: AssignmentStatement) -> Self
fn from(value: AssignmentStatement) -> Self
Source§impl From<BreakStatement> for Statement
impl From<BreakStatement> for Statement
Source§fn from(value: BreakStatement) -> Self
fn from(value: BreakStatement) -> Self
Source§impl From<CompoundStatement> for Statement
impl From<CompoundStatement> for Statement
Source§fn from(value: CompoundStatement) -> Self
fn from(value: CompoundStatement) -> Self
Source§impl From<ConstAssert> for Statement
impl From<ConstAssert> for Statement
Source§fn from(value: ConstAssertStatement) -> Self
fn from(value: ConstAssertStatement) -> Self
Source§impl From<ContinueStatement> for Statement
impl From<ContinueStatement> for Statement
Source§fn from(value: ContinueStatement) -> Self
fn from(value: ContinueStatement) -> Self
Source§impl From<Declaration> for Statement
impl From<Declaration> for Statement
Source§fn from(value: DeclarationStatement) -> Self
fn from(value: DeclarationStatement) -> Self
Source§impl From<DecrementStatement> for Statement
impl From<DecrementStatement> for Statement
Source§fn from(value: DecrementStatement) -> Self
fn from(value: DecrementStatement) -> Self
Source§impl From<DiscardStatement> for Statement
impl From<DiscardStatement> for Statement
Source§fn from(value: DiscardStatement) -> Self
fn from(value: DiscardStatement) -> Self
Source§impl From<ForStatement> for Statement
impl From<ForStatement> for Statement
Source§fn from(value: ForStatement) -> Self
fn from(value: ForStatement) -> Self
Source§impl From<FunctionCallStatement> for Statement
impl From<FunctionCallStatement> for Statement
Source§fn from(value: FunctionCallStatement) -> Self
fn from(value: FunctionCallStatement) -> Self
Source§impl From<IfStatement> for Statement
impl From<IfStatement> for Statement
Source§fn from(value: IfStatement) -> Self
fn from(value: IfStatement) -> Self
Source§impl From<IncrementStatement> for Statement
impl From<IncrementStatement> for Statement
Source§fn from(value: IncrementStatement) -> Self
fn from(value: IncrementStatement) -> Self
Source§impl From<LoopStatement> for Statement
impl From<LoopStatement> for Statement
Source§fn from(value: LoopStatement) -> Self
fn from(value: LoopStatement) -> Self
Source§impl From<ReturnStatement> for Statement
impl From<ReturnStatement> for Statement
Source§fn from(value: ReturnStatement) -> Self
fn from(value: ReturnStatement) -> Self
Source§impl From<SwitchStatement> for Statement
impl From<SwitchStatement> for Statement
Source§fn from(value: SwitchStatement) -> Self
fn from(value: SwitchStatement) -> Self
Source§impl From<WhileStatement> for Statement
impl From<WhileStatement> for Statement
Source§fn from(value: WhileStatement) -> Self
fn from(value: WhileStatement) -> Self
impl StructuralPartialEq for Statement
Auto Trait Implementations§
impl Freeze for Statement
impl RefUnwindSafe for Statement
impl Send for Statement
impl Sync for Statement
impl Unpin for Statement
impl UnwindSafe for Statement
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more