Enum Statement

Source
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

Source

pub fn is_scope(&self) -> bool

Returns true if this is a Statement::Scope, otherwise false

Source

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

Source

pub fn as_scope(&self) -> Option<&Scope>

Optionally returns references to the inner fields if this is a Statement::Scope, otherwise None

Source

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

Source

pub fn is_variable_definition(&self) -> bool

Returns true if this is a Statement::VariableDefinition, otherwise false

Source

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

Source

pub fn as_variable_definition(&self) -> Option<&VariableDefinition>

Optionally returns references to the inner fields if this is a Statement::VariableDefinition, otherwise None

Source

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

Source

pub fn is_variable_assignment(&self) -> bool

Returns true if this is a Statement::VariableAssignment, otherwise false

Source

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

Source

pub fn as_variable_assignment(&self) -> Option<&VariableAssignment>

Optionally returns references to the inner fields if this is a Statement::VariableAssignment, otherwise None

Source

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

Source

pub fn is_function_call(&self) -> bool

Returns true if this is a Statement::FunctionCall, otherwise false

Source

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

Source

pub fn as_function_call(&self) -> Option<&IdentifierAccess>

Optionally returns references to the inner fields if this is a Statement::FunctionCall, otherwise None

Source

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

Source

pub fn is_if_statement(&self) -> bool

Returns true if this is a Statement::IfStatement, otherwise false

Source

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

Source

pub fn as_if_statement(&self) -> Option<&IfStatement>

Optionally returns references to the inner fields if this is a Statement::IfStatement, otherwise None

Source

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

Source

pub fn is_while_statement(&self) -> bool

Returns true if this is a Statement::WhileStatement, otherwise false

Source

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

Source

pub fn as_while_statement(&self) -> Option<&WhileStatement>

Optionally returns references to the inner fields if this is a Statement::WhileStatement, otherwise None

Source

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

Source

pub fn is_loop_statement(&self) -> bool

Returns true if this is a Statement::LoopStatement, otherwise false

Source

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

Source

pub fn as_loop_statement(&self) -> Option<&LoopStatement>

Optionally returns references to the inner fields if this is a Statement::LoopStatement, otherwise None

Source

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

Source

pub fn is_return_statement(&self) -> bool

Returns true if this is a Statement::ReturnStatement, otherwise false

Source

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

Source

pub fn as_return_statement(&self) -> Option<&ReturnStatement>

Optionally returns references to the inner fields if this is a Statement::ReturnStatement, otherwise None

Source

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

Source

pub fn is_unsafe(&self) -> bool

Returns true if this is a Statement::Unsafe, otherwise false

Source

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

Source

pub fn as_unsafe(&self) -> Option<&Unsafe>

Optionally returns references to the inner fields if this is a Statement::Unsafe, otherwise None

Source

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

Source

pub fn is_break_statement(&self) -> bool

Returns true if this is a Statement::BreakStatement, otherwise false

Source

pub fn is_continue_statement(&self) -> bool

Returns true if this is a Statement::ContinueStatement, otherwise false

Source

pub fn is_null(&self) -> bool

Returns true if this is a Statement::Null, otherwise false

Source§

impl Statement

Source

pub fn is_valid(&self) -> bool

Trait Implementations§

Source§

impl Clone for Statement

Source§

fn clone(&self) -> Statement

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Statement

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Statement

Source§

fn default() -> Statement

Returns the “default value” for a type. Read more
Source§

impl Display for Statement

Source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.