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
impl Expression
Sourcepub fn is_parentheses(&self) -> bool
pub fn is_parentheses(&self) -> bool
Returns true if this is a Expression::Parentheses, otherwise false
Sourcepub fn as_parentheses_mut(&mut self) -> Option<&mut Parentheses>
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
Sourcepub fn as_parentheses(&self) -> Option<&Parentheses>
pub fn as_parentheses(&self) -> Option<&Parentheses>
Optionally returns references to the inner fields if this is a Expression::Parentheses, otherwise None
Sourcepub fn into_parentheses(self) -> Result<Parentheses, Self>
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
Sourcepub fn is_literal(&self) -> bool
pub fn is_literal(&self) -> bool
Returns true if this is a Expression::Literal, otherwise false
Sourcepub fn as_literal_mut(&mut self) -> Option<&mut Literal>
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
Sourcepub fn as_literal(&self) -> Option<&Literal>
pub fn as_literal(&self) -> Option<&Literal>
Optionally returns references to the inner fields if this is a Expression::Literal, otherwise None
Sourcepub fn into_literal(self) -> Result<Literal, Self>
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
Sourcepub fn is_unary_operation(&self) -> bool
pub fn is_unary_operation(&self) -> bool
Returns true if this is a Expression::UnaryOperation, otherwise false
Sourcepub fn as_unary_operation_mut(&mut self) -> Option<&mut UnaryOperation>
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
Sourcepub fn as_unary_operation(&self) -> Option<&UnaryOperation>
pub fn as_unary_operation(&self) -> Option<&UnaryOperation>
Optionally returns references to the inner fields if this is a Expression::UnaryOperation, otherwise None
Sourcepub fn into_unary_operation(self) -> Result<UnaryOperation, Self>
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
Sourcepub fn is_binary_operation(&self) -> bool
pub fn is_binary_operation(&self) -> bool
Returns true if this is a Expression::BinaryOperation, otherwise false
Sourcepub fn as_binary_operation_mut(&mut self) -> Option<&mut BinaryOperation>
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
Sourcepub fn as_binary_operation(&self) -> Option<&BinaryOperation>
pub fn as_binary_operation(&self) -> Option<&BinaryOperation>
Optionally returns references to the inner fields if this is a Expression::BinaryOperation, otherwise None
Sourcepub fn into_binary_operation(self) -> Result<BinaryOperation, Self>
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
Trait Implementations§
Source§impl Clone for Expression
impl Clone for Expression
Source§fn clone(&self) -> Expression
fn clone(&self) -> Expression
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more