Struct perfdata::ThresholdRange
source · [−]pub struct ThresholdRange { /* private fields */ }Expand description
A ThresholdRange delimits a numerical range in which a Perfdata Value will be considered
Warning or Critical ( See Perfdata::with_crit() and Perfdata::with_warn() )
ThresholdRanges are implemented to the Nagios Reference
Implementations
sourceimpl ThresholdRange
impl ThresholdRange
sourcepub fn above_pos<T: Into<f64>>(limit_top: T) -> Self
pub fn above_pos<T: Into<f64>>(limit_top: T) -> Self
This fails fails whenever the value is lower than the given limit
Parsed as ‘10’ Corresponds to: ‘< 0 && > 10’ or ‘outside the range of {0 .. 10}’
sourcepub fn below<T: Into<f64>>(limit_bottom: T) -> Self
pub fn below<T: Into<f64>>(limit_bottom: T) -> Self
This fails fails whenever the value is lower than the given limit
Parsed as ‘10:’ Corresponds to: ‘< 10’ or ‘outside {10 .. ∞}’
sourcepub fn above<T: Into<f64>>(limit_top: T) -> Self
pub fn above<T: Into<f64>>(limit_top: T) -> Self
This fails fails whenever the value is higher than the given limit
Parsed as ‘~ 10’ Corresponds to ‘> 10’ or ‘outside the range of {-∞ .. 10}’
sourcepub fn outside<T: Into<f64>>(start: T, end: T) -> Self
pub fn outside<T: Into<f64>>(start: T, end: T) -> Self
This fails fails whenever the value is outside the given limits
Parsed as ‘10:20’
Corresponds to < 10 && > 20 or outside the range of {10 .. 20}
sourcepub fn inside<T: Into<f64>>(start: T, end: T) -> Self
pub fn inside<T: Into<f64>>(start: T, end: T) -> Self
This fails fails whenever the value is inside the given limits
Parsed as ‘@10:20’
Corresponds to ≥ 10 and ≤ 20 or inside the range of {10 .. 20}
sourcepub fn is_alert<T: Into<f64>>(&self, value: T) -> bool
pub fn is_alert<T: Into<f64>>(&self, value: T) -> bool
This returns true if the given value lies inside the given Threshold and as such should produce a critical, or warning response. (See also with_crit() and with_warn().
Trait Implementations
sourceimpl Clone for ThresholdRange
impl Clone for ThresholdRange
sourcefn clone(&self) -> ThresholdRange
fn clone(&self) -> ThresholdRange
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for ThresholdRange
impl Debug for ThresholdRange
sourceimpl Display for ThresholdRange
impl Display for ThresholdRange
sourceimpl FromStr for ThresholdRange
impl FromStr for ThresholdRange
sourceimpl PartialEq<ThresholdRange> for ThresholdRange
impl PartialEq<ThresholdRange> for ThresholdRange
sourcefn eq(&self, other: &ThresholdRange) -> bool
fn eq(&self, other: &ThresholdRange) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &ThresholdRange) -> bool
fn ne(&self, other: &ThresholdRange) -> bool
This method tests for !=.
impl Copy for ThresholdRange
impl StructuralPartialEq for ThresholdRange
Auto Trait Implementations
impl RefUnwindSafe for ThresholdRange
impl Send for ThresholdRange
impl Sync for ThresholdRange
impl Unpin for ThresholdRange
impl UnwindSafe for ThresholdRange
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more