Enum Expression

Source
pub enum Expression {
    IntegerLiteral(IntegerLiteral),
    FloatLiteral(FloatLiteral),
    StringLiteral(StringLiteral),
    BooleanLiteral(BooleanLiteral),
    Parentheses(Parentheses),
    UnaryOperation(UnaryOperation),
    BinaryOperation(BinaryOperation),
    Identifier(IdentifierAccess),
    Null,
}

Variants§

§

IntegerLiteral(IntegerLiteral)

§

FloatLiteral(FloatLiteral)

§

StringLiteral(StringLiteral)

§

BooleanLiteral(BooleanLiteral)

§

Parentheses(Parentheses)

§

UnaryOperation(UnaryOperation)

§

BinaryOperation(BinaryOperation)

§

Identifier(IdentifierAccess)

§

Null

Implementations§

Source§

impl Expression

Source

pub fn is_integer_literal(&self) -> bool

Returns true if this is a Expression::IntegerLiteral, otherwise false

Source

pub fn as_integer_literal_mut(&mut self) -> Option<&mut IntegerLiteral>

Optionally returns mutable references to the inner fields if this is a Expression::IntegerLiteral, otherwise None

Source

pub fn as_integer_literal(&self) -> Option<&IntegerLiteral>

Optionally returns references to the inner fields if this is a Expression::IntegerLiteral, otherwise None

Source

pub fn into_integer_literal(self) -> Result<IntegerLiteral, Self>

Returns the inner fields if this is a Expression::IntegerLiteral, otherwise returns back the enum in the Err case of the result

Source

pub fn is_float_literal(&self) -> bool

Returns true if this is a Expression::FloatLiteral, otherwise false

Source

pub fn as_float_literal_mut(&mut self) -> Option<&mut FloatLiteral>

Optionally returns mutable references to the inner fields if this is a Expression::FloatLiteral, otherwise None

Source

pub fn as_float_literal(&self) -> Option<&FloatLiteral>

Optionally returns references to the inner fields if this is a Expression::FloatLiteral, otherwise None

Source

pub fn into_float_literal(self) -> Result<FloatLiteral, Self>

Returns the inner fields if this is a Expression::FloatLiteral, otherwise returns back the enum in the Err case of the result

Source

pub fn is_string_literal(&self) -> bool

Returns true if this is a Expression::StringLiteral, otherwise false

Source

pub fn as_string_literal_mut(&mut self) -> Option<&mut StringLiteral>

Optionally returns mutable references to the inner fields if this is a Expression::StringLiteral, otherwise None

Source

pub fn as_string_literal(&self) -> Option<&StringLiteral>

Optionally returns references to the inner fields if this is a Expression::StringLiteral, otherwise None

Source

pub fn into_string_literal(self) -> Result<StringLiteral, Self>

Returns the inner fields if this is a Expression::StringLiteral, otherwise returns back the enum in the Err case of the result

Source

pub fn is_boolean_literal(&self) -> bool

Returns true if this is a Expression::BooleanLiteral, otherwise false

Source

pub fn as_boolean_literal_mut(&mut self) -> Option<&mut BooleanLiteral>

Optionally returns mutable references to the inner fields if this is a Expression::BooleanLiteral, otherwise None

Source

pub fn as_boolean_literal(&self) -> Option<&BooleanLiteral>

Optionally returns references to the inner fields if this is a Expression::BooleanLiteral, otherwise None

Source

pub fn into_boolean_literal(self) -> Result<BooleanLiteral, Self>

Returns the inner fields if this is a Expression::BooleanLiteral, otherwise returns back the enum in the Err case of the result

Source

pub fn is_parentheses(&self) -> bool

Returns true if this is a Expression::Parentheses, otherwise false

Source

pub fn as_parentheses_mut(&mut self) -> Option<&mut Parentheses>

Optionally returns mutable references to the inner fields if this is a Expression::Parentheses, otherwise None

Source

pub fn as_parentheses(&self) -> Option<&Parentheses>

Optionally returns references to the inner fields if this is a Expression::Parentheses, otherwise None

Source

pub fn into_parentheses(self) -> Result<Parentheses, Self>

Returns the inner fields if this is a Expression::Parentheses, otherwise returns back the enum in the Err case of the result

Source

pub fn is_unary_operation(&self) -> bool

Returns true if this is a Expression::UnaryOperation, otherwise false

Source

pub fn as_unary_operation_mut(&mut self) -> Option<&mut UnaryOperation>

Optionally returns mutable references to the inner fields if this is a Expression::UnaryOperation, otherwise None

Source

pub fn as_unary_operation(&self) -> Option<&UnaryOperation>

Optionally returns references to the inner fields if this is a Expression::UnaryOperation, otherwise None

Source

pub fn into_unary_operation(self) -> Result<UnaryOperation, Self>

Returns the inner fields if this is a Expression::UnaryOperation, otherwise returns back the enum in the Err case of the result

Source

pub fn is_binary_operation(&self) -> bool

Returns true if this is a Expression::BinaryOperation, otherwise false

Source

pub fn as_binary_operation_mut(&mut self) -> Option<&mut BinaryOperation>

Optionally returns mutable references to the inner fields if this is a Expression::BinaryOperation, otherwise None

Source

pub fn as_binary_operation(&self) -> Option<&BinaryOperation>

Optionally returns references to the inner fields if this is a Expression::BinaryOperation, otherwise None

Source

pub fn into_binary_operation(self) -> Result<BinaryOperation, Self>

Returns the inner fields if this is a Expression::BinaryOperation, otherwise returns back the enum in the Err case of the result

Source

pub fn is_identifier(&self) -> bool

Returns true if this is a Expression::Identifier, otherwise false

Source

pub fn as_identifier_mut(&mut self) -> Option<&mut IdentifierAccess>

Optionally returns mutable references to the inner fields if this is a Expression::Identifier, otherwise None

Source

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

Optionally returns references to the inner fields if this is a Expression::Identifier, otherwise None

Source

pub fn into_identifier(self) -> Result<IdentifierAccess, Self>

Returns the inner fields if this is a Expression::Identifier, otherwise returns back the enum in the Err case of the result

Source

pub fn is_null(&self) -> bool

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

Source§

impl Expression

Source

pub fn is_valid(&self) -> bool

Trait Implementations§

Source§

impl Clone for Expression

Source§

fn clone(&self) -> Expression

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 Expression

Source§

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

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

impl Default for Expression

Source§

fn default() -> Expression

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

impl Display for Expression

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.