pub enum Statement {
Scope(Scope),
VariableDefinition(VariableDefinition),
VariableAssignment(VariableAssignment),
FunctionCall(IdentifierAccess),
IfStatement(IfStatement),
WhileStatement(WhileStatement),
LoopStatement(LoopStatement),
ReturnStatement(ReturnStatement),
Unsafe(Unsafe),
BreakStatement,
ContinueStatement,
Null,
}Variants§
Scope(Scope)
VariableDefinition(VariableDefinition)
VariableAssignment(VariableAssignment)
FunctionCall(IdentifierAccess)
IfStatement(IfStatement)
WhileStatement(WhileStatement)
LoopStatement(LoopStatement)
ReturnStatement(ReturnStatement)
Unsafe(Unsafe)
BreakStatement
ContinueStatement
Null
Implementations§
Source§impl Statement
impl Statement
Sourcepub fn as_scope_mut(&mut self) -> Option<&mut Scope>
pub fn as_scope_mut(&mut self) -> Option<&mut Scope>
Optionally returns mutable references to the inner fields if this is a Statement::Scope, otherwise None
Sourcepub fn as_scope(&self) -> Option<&Scope>
pub fn as_scope(&self) -> Option<&Scope>
Optionally returns references to the inner fields if this is a Statement::Scope, otherwise None
Sourcepub fn into_scope(self) -> Result<Scope, Self>
pub fn into_scope(self) -> Result<Scope, Self>
Returns the inner fields if this is a Statement::Scope, otherwise returns back the enum in the Err case of the result
Sourcepub fn is_variable_definition(&self) -> bool
pub fn is_variable_definition(&self) -> bool
Returns true if this is a Statement::VariableDefinition, otherwise false
Sourcepub fn as_variable_definition_mut(&mut self) -> Option<&mut VariableDefinition>
pub fn as_variable_definition_mut(&mut self) -> Option<&mut VariableDefinition>
Optionally returns mutable references to the inner fields if this is a Statement::VariableDefinition, otherwise None
Sourcepub fn as_variable_definition(&self) -> Option<&VariableDefinition>
pub fn as_variable_definition(&self) -> Option<&VariableDefinition>
Optionally returns references to the inner fields if this is a Statement::VariableDefinition, otherwise None
Sourcepub fn into_variable_definition(self) -> Result<VariableDefinition, Self>
pub fn into_variable_definition(self) -> Result<VariableDefinition, Self>
Returns the inner fields if this is a Statement::VariableDefinition, otherwise returns back the enum in the Err case of the result
Sourcepub fn is_variable_assignment(&self) -> bool
pub fn is_variable_assignment(&self) -> bool
Returns true if this is a Statement::VariableAssignment, otherwise false
Sourcepub fn as_variable_assignment_mut(&mut self) -> Option<&mut VariableAssignment>
pub fn as_variable_assignment_mut(&mut self) -> Option<&mut VariableAssignment>
Optionally returns mutable references to the inner fields if this is a Statement::VariableAssignment, otherwise None
Sourcepub fn as_variable_assignment(&self) -> Option<&VariableAssignment>
pub fn as_variable_assignment(&self) -> Option<&VariableAssignment>
Optionally returns references to the inner fields if this is a Statement::VariableAssignment, otherwise None
Sourcepub fn into_variable_assignment(self) -> Result<VariableAssignment, Self>
pub fn into_variable_assignment(self) -> Result<VariableAssignment, Self>
Returns the inner fields if this is a Statement::VariableAssignment, otherwise returns back the enum in the Err case of the result
Sourcepub fn is_function_call(&self) -> bool
pub fn is_function_call(&self) -> bool
Returns true if this is a Statement::FunctionCall, otherwise false
Sourcepub fn as_function_call_mut(&mut self) -> Option<&mut IdentifierAccess>
pub fn as_function_call_mut(&mut self) -> Option<&mut IdentifierAccess>
Optionally returns mutable references to the inner fields if this is a Statement::FunctionCall, otherwise None
Sourcepub fn as_function_call(&self) -> Option<&IdentifierAccess>
pub fn as_function_call(&self) -> Option<&IdentifierAccess>
Optionally returns references to the inner fields if this is a Statement::FunctionCall, otherwise None
Sourcepub fn into_function_call(self) -> Result<IdentifierAccess, Self>
pub fn into_function_call(self) -> Result<IdentifierAccess, Self>
Returns the inner fields if this is a Statement::FunctionCall, otherwise returns back the enum in the Err case of the result
Sourcepub fn is_if_statement(&self) -> bool
pub fn is_if_statement(&self) -> bool
Returns true if this is a Statement::IfStatement, otherwise false
Sourcepub fn as_if_statement_mut(&mut self) -> Option<&mut IfStatement>
pub fn as_if_statement_mut(&mut self) -> Option<&mut IfStatement>
Optionally returns mutable references to the inner fields if this is a Statement::IfStatement, otherwise None
Sourcepub fn as_if_statement(&self) -> Option<&IfStatement>
pub fn as_if_statement(&self) -> Option<&IfStatement>
Optionally returns references to the inner fields if this is a Statement::IfStatement, otherwise None
Sourcepub fn into_if_statement(self) -> Result<IfStatement, Self>
pub fn into_if_statement(self) -> Result<IfStatement, Self>
Returns the inner fields if this is a Statement::IfStatement, otherwise returns back the enum in the Err case of the result
Sourcepub fn is_while_statement(&self) -> bool
pub fn is_while_statement(&self) -> bool
Returns true if this is a Statement::WhileStatement, otherwise false
Sourcepub fn as_while_statement_mut(&mut self) -> Option<&mut WhileStatement>
pub fn as_while_statement_mut(&mut self) -> Option<&mut WhileStatement>
Optionally returns mutable references to the inner fields if this is a Statement::WhileStatement, otherwise None
Sourcepub fn as_while_statement(&self) -> Option<&WhileStatement>
pub fn as_while_statement(&self) -> Option<&WhileStatement>
Optionally returns references to the inner fields if this is a Statement::WhileStatement, otherwise None
Sourcepub fn into_while_statement(self) -> Result<WhileStatement, Self>
pub fn into_while_statement(self) -> Result<WhileStatement, Self>
Returns the inner fields if this is a Statement::WhileStatement, otherwise returns back the enum in the Err case of the result
Sourcepub fn is_loop_statement(&self) -> bool
pub fn is_loop_statement(&self) -> bool
Returns true if this is a Statement::LoopStatement, otherwise false
Sourcepub fn as_loop_statement_mut(&mut self) -> Option<&mut LoopStatement>
pub fn as_loop_statement_mut(&mut self) -> Option<&mut LoopStatement>
Optionally returns mutable references to the inner fields if this is a Statement::LoopStatement, otherwise None
Sourcepub fn as_loop_statement(&self) -> Option<&LoopStatement>
pub fn as_loop_statement(&self) -> Option<&LoopStatement>
Optionally returns references to the inner fields if this is a Statement::LoopStatement, otherwise None
Sourcepub fn into_loop_statement(self) -> Result<LoopStatement, Self>
pub fn into_loop_statement(self) -> Result<LoopStatement, Self>
Returns the inner fields if this is a Statement::LoopStatement, otherwise returns back the enum in the Err case of the result
Sourcepub fn is_return_statement(&self) -> bool
pub fn is_return_statement(&self) -> bool
Returns true if this is a Statement::ReturnStatement, otherwise false
Sourcepub fn as_return_statement_mut(&mut self) -> Option<&mut ReturnStatement>
pub fn as_return_statement_mut(&mut self) -> Option<&mut ReturnStatement>
Optionally returns mutable references to the inner fields if this is a Statement::ReturnStatement, otherwise None
Sourcepub fn as_return_statement(&self) -> Option<&ReturnStatement>
pub fn as_return_statement(&self) -> Option<&ReturnStatement>
Optionally returns references to the inner fields if this is a Statement::ReturnStatement, otherwise None
Sourcepub fn into_return_statement(self) -> Result<ReturnStatement, Self>
pub fn into_return_statement(self) -> Result<ReturnStatement, Self>
Returns the inner fields if this is a Statement::ReturnStatement, otherwise returns back the enum in the Err case of the result
Sourcepub fn as_unsafe_mut(&mut self) -> Option<&mut Unsafe>
pub fn as_unsafe_mut(&mut self) -> Option<&mut Unsafe>
Optionally returns mutable references to the inner fields if this is a Statement::Unsafe, otherwise None
Sourcepub fn as_unsafe(&self) -> Option<&Unsafe>
pub fn as_unsafe(&self) -> Option<&Unsafe>
Optionally returns references to the inner fields if this is a Statement::Unsafe, otherwise None
Sourcepub fn into_unsafe(self) -> Result<Unsafe, Self>
pub fn into_unsafe(self) -> Result<Unsafe, Self>
Returns the inner fields if this is a Statement::Unsafe, otherwise returns back the enum in the Err case of the result
Sourcepub fn is_break_statement(&self) -> bool
pub fn is_break_statement(&self) -> bool
Returns true if this is a Statement::BreakStatement, otherwise false
Sourcepub fn is_continue_statement(&self) -> bool
pub fn is_continue_statement(&self) -> bool
Returns true if this is a Statement::ContinueStatement, otherwise false