Struct PerfdataSet

Source
pub struct PerfdataSet<'a> { /* private fields */ }
Expand description

A PerfdataSet is a collection of Perfdata. It can be built via PerfdataSet::new(), from Iterators with Item=<Perfdata>, or from a Vec<Perfdata>.

Implementations§

Source§

impl<'a> PerfdataSet<'a>

Source

pub fn new() -> Self

Create a new PerfdataSet

Source

pub fn add(&mut self, pd: Perfdata<'a>)

Add Perfdata to a PerfdataSet

Source

pub fn is_empty(&self) -> bool

Returns true if the PerfdataSet does not contain any Perfdata

Source

pub fn data(&self) -> impl Iterator<Item = &Perfdata<'a>>

Returns an iterator over all contained Perfdata

Source

pub fn critical(&self) -> impl Iterator<Item = &Perfdata<'a>>

Returns an iterator over all Perfdata which exceeds their critical threshold

Source

pub fn has_critical(&self) -> bool

Returns true if any of the contained Perfdatahas a critical Threshold assigned and the value exceeds the Threshold

Source

pub fn warning(&self) -> impl Iterator<Item = &Perfdata<'a>>

Returns an iterator over all Perfdata which exceeds their warning threshold

Source

pub fn has_warning(&self) -> bool

Returns true if any of the contained Perfdatahas a warning Threshold assigned and the value exceeds the Threshold

Source

pub fn status(&self) -> MonitoringStatus

Returns the MonitoringStatus reflecting the worst status based on Thresholds Critical is worse than Warning is worse than OK

Trait Implementations§

Source§

impl<'a> Debug for PerfdataSet<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> Default for PerfdataSet<'a>

Source§

fn default() -> PerfdataSet<'a>

Returns the “default value” for a type. Read more
Source§

impl<'a> Display for PerfdataSet<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> From<Vec<Perfdata<'a>>> for PerfdataSet<'a>

Source§

fn from(data: Vec<Perfdata<'a>>) -> Self

Converts to this type from the input type.
Source§

impl<'a> FromIterator<Perfdata<'a>> for PerfdataSet<'a>

Source§

fn from_iter<T: IntoIterator<Item = Perfdata<'a>>>(iter: T) -> Self

Creates a value from an iterator. Read more
Source§

impl<'a> PartialEq for PerfdataSet<'a>

Source§

fn eq(&self, other: &PerfdataSet<'a>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> TryFrom<&'a str> for PerfdataSet<'a>

Source§

type Error = PerfdataParseError

The type returned in the event of a conversion error.
Source§

fn try_from(s: &'a str) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'a> StructuralPartialEq for PerfdataSet<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for PerfdataSet<'a>

§

impl<'a> RefUnwindSafe for PerfdataSet<'a>

§

impl<'a> Send for PerfdataSet<'a>

§

impl<'a> Sync for PerfdataSet<'a>

§

impl<'a> Unpin for PerfdataSet<'a>

§

impl<'a> UnwindSafe for PerfdataSet<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.