[][src]Struct prometheus_parser::Matching

pub struct Matching {
    pub op: MatchingOp,
    pub labels: Vec<String>,
    pub group: Option<MatchingGroup>,
    pub span: Option<Span>,
}

An operator matching clause

Fields

op: MatchingOplabels: Vec<String>

A list of labels to which the operator is applied

group: Option<MatchingGroup>

An optional grouping clause for many-to-one and one-to-many vector matches

span: Option<Span>

Methods

impl Matching[src]

pub fn new(op: MatchingOp) -> Self[src]

pub fn on() -> Self[src]

Creates a Matching cause with the On operator

pub fn ignoring() -> Self[src]

Creates a Matching clause using the Ignoring operator

pub fn op(self, op: MatchingOp) -> Self[src]

Replaces this Matching's operator

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

Adds a label key to this Matching

pub fn labels(self, labels: &[&str]) -> Self[src]

Replaces this Matching's labels with the given set

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

Clears this Matching's set of labels

pub fn group(self, group: MatchingGroup) -> Self[src]

Sets or replaces this Matching's group clause

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

Clears this Matching's group clause

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

Trait Implementations

impl Clone for Matching[src]

impl Debug for Matching[src]

impl Display for Matching[src]

impl Eq for Matching[src]

impl PartialEq<Matching> for Matching[src]

impl StructuralEq for Matching[src]

impl StructuralPartialEq for Matching[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.