[−][src]Enum prometheus_parser::Expression
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
Methods
impl Expression[src]
pub fn group(self) -> Expression[src]
Wraps this Expression in a Group, consuming this Expression but returning an owned Group.
pub fn return_value(&self) -> ReturnValue[src]
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.
pub fn as_f64(&self) -> Option<f64>[src]
If this Expression is a Float, returns its value. Otherwise, returns None.
pub fn as_str(&self) -> Option<&str>[src]
If this Expression is a String, returns its value. Otherwise, returns None.
Trait Implementations
impl Clone for Expression[src]
fn clone(&self) -> Expression[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
impl Debug for Expression[src]
impl Display for Expression[src]
impl PartialEq<Expression> for Expression[src]
fn eq(&self, other: &Expression) -> bool[src]
fn ne(&self, other: &Expression) -> bool[src]
impl StructuralPartialEq for Expression[src]
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
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T> ToString for T where
T: Display + ?Sized, [src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,