pub struct Comparison {
pub comparator: Comparator,
pub threshold: f64,
}Expand description
A comparator and its threshold, as in <=10.
Fields§
§comparator: ComparatorTest between a value and Self::threshold.
threshold: f64Value a sample is compared with.
Implementations§
Source§impl Comparison
impl Comparison
Sourcepub fn holds(self, value: f64) -> bool
pub fn holds(self, value: f64) -> bool
Returns whether value passes the comparison. A NaN value never passes, under any comparator.
Sourcepub fn check(self) -> Result<(), ComparisonError>
pub fn check(self) -> Result<(), ComparisonError>
Checks that the threshold is finite, as a threshold parsed with FromStr always is.
§Errors
Returns ComparisonError::BadThreshold for a threshold that is infinite or NaN.
Trait Implementations§
Source§impl Clone for Comparison
impl Clone for Comparison
impl Copy for Comparison
Source§impl Debug for Comparison
impl Debug for Comparison
Source§impl Display for Comparison
impl Display for Comparison
Source§impl FromStr for Comparison
impl FromStr for Comparison
Source§impl PartialEq for Comparison
impl PartialEq for Comparison
impl StructuralPartialEq for Comparison
Auto Trait Implementations§
impl Freeze for Comparison
impl RefUnwindSafe for Comparison
impl Send for Comparison
impl Sync for Comparison
impl Unpin for Comparison
impl UnsafeUnpin for Comparison
impl UnwindSafe for Comparison
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more