Struct prometheus_parser::Operator[][src]

pub struct Operator {
    pub kind: OperatorKind,
    pub lhs: BExpression,
    pub rhs: BExpression,
    pub matching: Option<Matching>,
    pub span: Option<Span>,
}
Expand description

A binary operator expression with left- and right-hand sides.

Operator expressions may optionally have a matching clause for more specific vector matching behavior.

Note that operator precedence is accounted for at parse-time, so the resulting tree (i.e. lhs/rhs expressions) should already account for un-grouped expressions at the same syntax level.

Fields

kind: OperatorKind

This Operator’s function (multiply, divide, power, equals, etc)

lhs: BExpression

The left-hand-side expression

rhs: BExpression

The right-hand-side expression

matching: Option<Matching>

An optional matching clause for this operator (on(...), ignoring(...))

span: Option<Span>

Implementations

Sets or replaces this Operator’s Matching clause

Clears this Operator’s Matching clause, if any

Wraps this Operator in an Expression

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.