Trait nagiosplugin::Metric[][src]

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

Loading content...

Required methods

fn name(&self) -> &str[src]

fn state(&self) -> Option<State>[src]

fn value(&self) -> Self::Output[src]

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

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

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

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

fn unit_of_measurement(&self) -> &Unit[src]

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...