pub enum Expression {
Show 17 variants
String(String),
Number(f64),
Bool(bool),
Null,
Duration(Duration),
Array(Vec<Expression>),
Object(HashMap<String, Expression>),
Variable(String),
Reference(String),
IndexedReference(String, String),
Identifier(String),
Pipeline(Vec<String>),
BinaryOp(Box<Expression>, BinaryOperator, Box<Expression>),
Block(Vec<Statement>),
TextBlock(Vec<String>),
OperatorCall(String, String, Option<String>, Option<String>),
AtOperatorCall(String, HashMap<String, Expression>),
}Variants§
String(String)
Number(f64)
Bool(bool)
Null
Duration(Duration)
Array(Vec<Expression>)
Object(HashMap<String, Expression>)
Variable(String)
Reference(String)
IndexedReference(String, String)
Identifier(String)
Pipeline(Vec<String>)
BinaryOp(Box<Expression>, BinaryOperator, Box<Expression>)
Block(Vec<Statement>)
TextBlock(Vec<String>)
OperatorCall(String, String, Option<String>, Option<String>)
AtOperatorCall(String, HashMap<String, Expression>)
Implementations§
Source§impl Expression
impl Expression
pub fn binary(left: Expression, op: BinaryOperator, right: Expression) -> Self
pub fn as_string(&self) -> Option<String>
pub fn as_number(&self) -> Option<f64>
pub fn as_bool(&self) -> Option<bool>
pub fn as_array(&self) -> Option<Vec<Expression>>
pub fn as_object(&self) -> Option<&HashMap<String, Expression>>
pub fn to_value(&self) -> Value
Trait Implementations§
Source§impl Clone for Expression
impl Clone for Expression
Source§fn clone(&self) -> Expression
fn clone(&self) -> Expression
Returns a duplicate 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 moreAuto Trait Implementations§
impl Freeze for Expression
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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