Enum Statement

Source
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§

Implementations§

Source§

impl Statement

Source

pub const fn is_void(&self) -> bool

Returns true if this value is of type Void. Returns false otherwise

Source

pub const fn is_compound(&self) -> bool

Returns true if this value is of type Compound. Returns false otherwise

Source

pub const fn is_assignment(&self) -> bool

Returns true if this value is of type Assignment. Returns false otherwise

Source

pub const fn is_increment(&self) -> bool

Returns true if this value is of type Increment. Returns false otherwise

Source

pub const fn is_decrement(&self) -> bool

Returns true if this value is of type Decrement. Returns false otherwise

Source

pub const fn is_if(&self) -> bool

Returns true if this value is of type If. Returns false otherwise

Source

pub const fn is_switch(&self) -> bool

Returns true if this value is of type Switch. Returns false otherwise

Source

pub const fn is_loop(&self) -> bool

Returns true if this value is of type Loop. Returns false otherwise

Source

pub const fn is_for(&self) -> bool

Returns true if this value is of type For. Returns false otherwise

Source

pub const fn is_while(&self) -> bool

Returns true if this value is of type While. Returns false otherwise

Source

pub const fn is_break(&self) -> bool

Returns true if this value is of type Break. Returns false otherwise

Source

pub const fn is_continue(&self) -> bool

Returns true if this value is of type Continue. Returns false otherwise

Source

pub const fn is_return(&self) -> bool

Returns true if this value is of type Return. Returns false otherwise

Source

pub const fn is_discard(&self) -> bool

Returns true if this value is of type Discard. Returns false otherwise

Source

pub const fn is_function_call(&self) -> bool

Returns true if this value is of type FunctionCall. Returns false otherwise

Source

pub const fn is_const_assert(&self) -> bool

Returns true if this value is of type ConstAssert. Returns false otherwise

Source

pub const fn is_declaration(&self) -> bool

Returns true if this value is of type Declaration. Returns false otherwise

Source§

impl Statement

Source

pub fn unwrap_void(self)

Unwraps this value to the Statement::Void variant. Panics if this value is of any other type.

Source

pub fn unwrap_compound(self) -> CompoundStatement

Unwraps this value to the Statement::Compound variant. Panics if this value is of any other type.

Source

pub fn unwrap_assignment(self) -> AssignmentStatement

Unwraps this value to the Statement::Assignment variant. Panics if this value is of any other type.

Source

pub fn unwrap_increment(self) -> IncrementStatement

Unwraps this value to the Statement::Increment variant. Panics if this value is of any other type.

Source

pub fn unwrap_decrement(self) -> DecrementStatement

Unwraps this value to the Statement::Decrement variant. Panics if this value is of any other type.

Source

pub fn unwrap_if(self) -> IfStatement

Unwraps this value to the Statement::If variant. Panics if this value is of any other type.

Source

pub fn unwrap_switch(self) -> SwitchStatement

Unwraps this value to the Statement::Switch variant. Panics if this value is of any other type.

Source

pub fn unwrap_loop(self) -> LoopStatement

Unwraps this value to the Statement::Loop variant. Panics if this value is of any other type.

Source

pub fn unwrap_for(self) -> ForStatement

Unwraps this value to the Statement::For variant. Panics if this value is of any other type.

Source

pub fn unwrap_while(self) -> WhileStatement

Unwraps this value to the Statement::While variant. Panics if this value is of any other type.

Source

pub fn unwrap_break(self) -> BreakStatement

Unwraps this value to the Statement::Break variant. Panics if this value is of any other type.

Source

pub fn unwrap_continue(self) -> ContinueStatement

Unwraps this value to the Statement::Continue variant. Panics if this value is of any other type.

Source

pub fn unwrap_return(self) -> ReturnStatement

Unwraps this value to the Statement::Return variant. Panics if this value is of any other type.

Source

pub fn unwrap_discard(self) -> DiscardStatement

Unwraps this value to the Statement::Discard variant. Panics if this value is of any other type.

Source

pub fn unwrap_function_call(self) -> FunctionCallStatement

Unwraps this value to the Statement::FunctionCall variant. Panics if this value is of any other type.

Source

pub fn unwrap_const_assert(self) -> ConstAssertStatement

Unwraps this value to the Statement::ConstAssert variant. Panics if this value is of any other type.

Source

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

Source

pub fn remove_voids(&mut self)

Remove all Statement::Void

Trait Implementations§

Source§

impl Clone for Statement

Source§

fn clone(&self) -> Statement

Returns a duplicate 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 Display for Statement

Source§

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

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

impl From<AssignmentStatement> for Statement

Source§

fn from(value: AssignmentStatement) -> Self

Converts to this type from the input type.
Source§

impl From<BreakStatement> for Statement

Source§

fn from(value: BreakStatement) -> Self

Converts to this type from the input type.
Source§

impl From<CompoundStatement> for Statement

Source§

fn from(value: CompoundStatement) -> Self

Converts to this type from the input type.
Source§

impl From<ConstAssert> for Statement

Source§

fn from(value: ConstAssertStatement) -> Self

Converts to this type from the input type.
Source§

impl From<ContinueStatement> for Statement

Source§

fn from(value: ContinueStatement) -> Self

Converts to this type from the input type.
Source§

impl From<Declaration> for Statement

Source§

fn from(value: DeclarationStatement) -> Self

Converts to this type from the input type.
Source§

impl From<DecrementStatement> for Statement

Source§

fn from(value: DecrementStatement) -> Self

Converts to this type from the input type.
Source§

impl From<DiscardStatement> for Statement

Source§

fn from(value: DiscardStatement) -> Self

Converts to this type from the input type.
Source§

impl From<ForStatement> for Statement

Source§

fn from(value: ForStatement) -> Self

Converts to this type from the input type.
Source§

impl From<FunctionCallStatement> for Statement

Source§

fn from(value: FunctionCallStatement) -> Self

Converts to this type from the input type.
Source§

impl From<IfStatement> for Statement

Source§

fn from(value: IfStatement) -> Self

Converts to this type from the input type.
Source§

impl From<IncrementStatement> for Statement

Source§

fn from(value: IncrementStatement) -> Self

Converts to this type from the input type.
Source§

impl From<LoopStatement> for Statement

Source§

fn from(value: LoopStatement) -> Self

Converts to this type from the input type.
Source§

impl From<ReturnStatement> for Statement

Source§

fn from(value: ReturnStatement) -> Self

Converts to this type from the input type.
Source§

impl From<SwitchStatement> for Statement

Source§

fn from(value: SwitchStatement) -> Self

Converts to this type from the input type.
Source§

impl From<WhileStatement> for Statement

Source§

fn from(value: WhileStatement) -> Self

Converts to this type from the input type.
Source§

impl FromStr for Statement

Source§

type Err = Error

The associated error which can be returned from parsing.
Source§

fn from_str(source: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
Source§

impl PartialEq for Statement

Source§

fn eq(&self, other: &Statement) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Statement

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
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.