[][src]Struct prometheus_parser::Operator

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

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>

Methods

impl Operator[src]

pub fn new(kind: OperatorKind, lhs: Expression, rhs: Expression) -> Self[src]

pub fn matching(self, matching: Matching) -> Self[src]

Sets or replaces this Operator's Matching clause

pub fn clear_matching(self) -> Self[src]

Clears this Operator's Matching clause, if any

pub fn span<S: Into<Span>>(self, span: S) -> Self[src]

pub fn wrap(self) -> Expression[src]

Wraps this Operator in an Expression

pub fn return_value(&self) -> ReturnValue[src]

Trait Implementations

impl Clone for Operator[src]

impl Debug for Operator[src]

impl Display for Operator[src]

impl PartialEq<Operator> for Operator[src]

impl StructuralPartialEq for Operator[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.