Enum mzpeaks::mass_error::Tolerance
source · pub enum Tolerance {
PPM(f64),
Da(f64),
}
Variants§
Implementations§
source§impl Tolerance
impl Tolerance
sourcepub fn bounds(&self, query: f64) -> (f64, f64)
pub fn bounds(&self, query: f64) -> (f64, f64)
The interval around query
which is within this Tolerance
instance’s range.
sourcepub fn call(&self, query: f64, reference: f64) -> f64
pub fn call(&self, query: f64, reference: f64) -> f64
Compute the error between the two masses, in the appropriate units
sourcepub fn test(&self, query: f64, reference: f64) -> bool
pub fn test(&self, query: f64, reference: f64) -> bool
Check if query
is within the tolerated error interval around reference
sourcepub fn format_error(&self, query: f64, reference: f64) -> String
pub fn format_error(&self, query: f64, reference: f64) -> String
Format the error between two masses with the appropriate units
pub fn as_range(&self, query: f64) -> RangeInclusive<f64>
Trait Implementations§
source§impl FromStr for Tolerance
impl FromStr for Tolerance
source§fn from_str(s: &str) -> Result<Self, Self::Err>
fn from_str(s: &str) -> Result<Self, Self::Err>
Parse a string of the form “magnitude:f64unit:da|ppm?”
§type Err = ToleranceParsingError
type Err = ToleranceParsingError
The associated error which can be returned from parsing.
source§impl Mul<f64> for Tolerance
impl Mul<f64> for Tolerance
Tolerance objects can by scaled up or down by a floating point value
source§impl PartialEq for Tolerance
impl PartialEq for Tolerance
source§impl PartialOrd for Tolerance
impl PartialOrd for Tolerance
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for Tolerance
impl StructuralPartialEq for Tolerance
Auto Trait Implementations§
impl RefUnwindSafe for Tolerance
impl Send for Tolerance
impl Sync for Tolerance
impl Unpin for Tolerance
impl UnwindSafe for Tolerance
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