Enum Expression

Source
pub enum Expression {
    Parentheses(Parentheses),
    Literal(Literal),
    UnaryOperation(UnaryOperation),
    BinaryOperation(BinaryOperation),
    Null,
}
Expand description

An Expression

Variants§

§

Parentheses(Parentheses)

Parentheses

§

Literal(Literal)

Any singular literal

§

UnaryOperation(UnaryOperation)

A unary operation

§

BinaryOperation(BinaryOperation)

A binary operation

§

Null

Implementations§

Source§

impl Expression

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_literal(&self) -> bool

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

Source

pub fn as_literal_mut(&mut self) -> Option<&mut Literal>

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

Source

pub fn as_literal(&self) -> Option<&Literal>

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

Source

pub fn into_literal(self) -> Result<Literal, Self>

Returns the inner fields if this is a Expression::Literal, 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_null(&self) -> bool

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

Source§

impl Expression

Source

pub fn is_valid(&self) -> bool

Checks if the instance of expression is valid

Trait Implementations§

Source§

impl Clone for Expression

Source§

fn clone(&self) -> Expression

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 Default for Expression

Source§

fn default() -> Expression

Returns the “default value” for a type. 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, 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.