pub enum Expression {
Float(f64),
String(String),
Selector(Selector),
Group(Group),
Function(Function),
Operator(Operator),
}
Expand description
A root expression node.
These are all valid root expression types.
Variants§
Float(f64)
A single scalar float
String(String)
A single scalar string.
Prometheus’ docs claim strings aren’t currently implemented, but they’re valid as function arguments.
Selector(Selector)
A metric selector
Group(Group)
A grouped expression wrapped in parentheses
Function(Function)
A function call
Operator(Operator)
A binary operator expression
Implementations§
Source§impl Expression
impl Expression
Sourcepub fn group(self) -> Expression
pub fn group(self) -> Expression
Wraps this Expression in a Group, consuming this Expression but returning an owned Group.
Sourcepub fn return_value(&self) -> ReturnValue
pub fn return_value(&self) -> ReturnValue
Determines a predicted ReturnValue
for this Expression. A ReturnValue
includes a predicted data type and a set of label operations that may
affect which labels are returned.
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 moreSource§impl Debug for Expression
impl Debug for Expression
Source§impl Display for Expression
impl Display for Expression
Source§impl PartialEq for Expression
impl PartialEq for Expression
impl StructuralPartialEq for Expression
Auto 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