Enum prometheus_parser::Expression[][src]

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)

Tuple Fields

0: f64

A single scalar float

String(String)

Tuple Fields

0: String

A single scalar string.

Prometheus’ docs claim strings aren’t currently implemented, but they’re valid as function arguments.

Selector(Selector)

Tuple Fields

A metric selector

Group(Group)

Tuple Fields

0: Group

A grouped expression wrapped in parentheses

Function(Function)

Tuple Fields

A function call

Operator(Operator)

Tuple Fields

A binary operator expression

Implementations

Wraps this Expression in a Group, consuming this Expression but returning an owned Group.

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.

If this Expression is a Float, returns its value. Otherwise, returns None.

If this Expression is a String, returns its value. Otherwise, returns None.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.