Enum parser_database::ast::Expression
source · pub enum Expression {
NumericValue(String, Span),
StringValue(String, Span),
ConstantValue(String, Span),
Function(String, ArgumentsList, Span),
Array(Vec<Expression>, Span),
}
Expand description
Represents arbitrary, even nested, expressions.
Variants§
NumericValue(String, Span)
Any numeric value e.g. floats or ints.
StringValue(String, Span)
Any string value.
ConstantValue(String, Span)
Any literal constant, basically a string which was not inside “…”. This is used for representing builtin enums and boolean constants (true and false).
Function(String, ArgumentsList, Span)
A function call like node with a name and arguments.
Array(Vec<Expression>, Span)
An array of other values.
Implementations§
source§impl Expression
impl Expression
pub fn as_array(&self) -> Option<(&[Expression], Span)>
pub fn as_string_value(&self) -> Option<(&str, Span)>
pub fn as_constant_value(&self) -> Option<(&str, Span)>
pub fn as_function(&self) -> Option<(&str, &ArgumentsList, Span)>
pub fn as_numeric_value(&self) -> Option<(&str, Span)>
pub fn span(&self) -> Span
pub fn is_env_expression(&self) -> bool
sourcepub fn describe_value_type(&self) -> &'static str
pub fn describe_value_type(&self) -> &'static str
Creates a friendly readable representation for a value’s type.
pub fn is_function(&self) -> bool
pub fn is_array(&self) -> bool
pub fn is_string(&self) -> bool
Trait Implementations§
source§impl Clone for Expression
impl Clone for Expression
source§fn clone(&self) -> Expression
fn clone(&self) -> Expression
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for Expression
impl Debug for Expression
Auto Trait Implementations§
impl RefUnwindSafe for Expression
impl Send for Expression
impl Sync for Expression
impl Unpin for Expression
impl UnwindSafe for Expression
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more