[][src]Trait nagiosplugin::Metric

pub trait Metric {
    type Output: ToPerfString;
    fn name(&self) -> &str;
fn state(&self) -> Option<State>;
fn value(&self) -> Self::Output;
fn warning(&self) -> Option<Self::Output>;
fn critical(&self) -> Option<Self::Output>;
fn min(&self) -> Option<Self::Output>;
fn max(&self) -> Option<Self::Output>;
fn unit_of_measurement(&self) -> &Unit; }

This trait can be implemented for any kind of metric and will be used to generate the final string output for nagios. Calls to the functions should return immediately and not query the service every time.

Associated Types

type Output: ToPerfString

Loading content...

Required methods

fn name(&self) -> &str

fn state(&self) -> Option<State>

fn value(&self) -> Self::Output

fn warning(&self) -> Option<Self::Output>

fn critical(&self) -> Option<Self::Output>

fn min(&self) -> Option<Self::Output>

fn max(&self) -> Option<Self::Output>

fn unit_of_measurement(&self) -> &Unit

Loading content...

Implementors

impl<T> Metric for PartialOrdMetric<T> where
    T: PartialOrd + ToPerfString + Clone
[src]

type Output = T

impl<T> Metric for SimpleMetric<T> where
    T: ToPerfString + Clone
[src]

type Output = T

Loading content...