pub struct Tolerance<Lhs, Rhs = Lhs>{
pub eps: EpsToleranceType<Lhs, Rhs>,
pub ulps: UlpsToleranceType<Lhs, Rhs>,
}Expand description
A tolerance data type that is used for nearly comparisons based on a tolerance value.
This data type combines an absolute epsilon value that will be used for comparisons based on absolute epsilon values and an ulps value that will be used for comparisons based on ulps values.
Fields§
§eps: EpsToleranceType<Lhs, Rhs>§ulps: UlpsToleranceType<Lhs, Rhs>Implementations§
Source§impl<Lhs, Rhs> Tolerance<Lhs, Rhs>
impl<Lhs, Rhs> Tolerance<Lhs, Rhs>
pub fn new( eps: EpsToleranceType<Lhs, Rhs>, ulps: UlpsToleranceType<Lhs, Rhs>, ) -> Self
Trait Implementations§
Source§impl<Lhs, Rhs> Display for Tolerance<Lhs, Rhs>where
Lhs: ?Sized + EpsTolerance<Rhs> + UlpsTolerance<Rhs>,
Rhs: ?Sized,
EpsToleranceType<Lhs, Rhs>: Display,
UlpsToleranceType<Lhs, Rhs>: Display,
impl<Lhs, Rhs> Display for Tolerance<Lhs, Rhs>where
Lhs: ?Sized + EpsTolerance<Rhs> + UlpsTolerance<Rhs>,
Rhs: ?Sized,
EpsToleranceType<Lhs, Rhs>: Display,
UlpsToleranceType<Lhs, Rhs>: Display,
Source§impl<Lhs, Rhs> From<(<Lhs as EpsTolerance<Rhs>>::T, <Lhs as UlpsTolerance<Rhs>>::T)> for Tolerance<Lhs, Rhs>
impl<Lhs, Rhs> From<(<Lhs as EpsTolerance<Rhs>>::T, <Lhs as UlpsTolerance<Rhs>>::T)> for Tolerance<Lhs, Rhs>
Source§fn from(
tuple: (EpsToleranceType<Lhs, Rhs>, UlpsToleranceType<Lhs, Rhs>),
) -> Self
fn from( tuple: (EpsToleranceType<Lhs, Rhs>, UlpsToleranceType<Lhs, Rhs>), ) -> Self
Converts to this type from the input type.
Source§impl<Lhs, Rhs> From<Tolerance<Lhs, Rhs>> for (EpsToleranceType<Lhs, Rhs>, UlpsToleranceType<Lhs, Rhs>)
impl<Lhs, Rhs> From<Tolerance<Lhs, Rhs>> for (EpsToleranceType<Lhs, Rhs>, UlpsToleranceType<Lhs, Rhs>)
Source§impl<Lhs, Rhs> PartialEq for Tolerance<Lhs, Rhs>where
Lhs: ?Sized + EpsTolerance<Rhs> + UlpsTolerance<Rhs>,
Rhs: ?Sized,
EpsToleranceType<Lhs, Rhs>: PartialEq,
UlpsToleranceType<Lhs, Rhs>: PartialEq,
impl<Lhs, Rhs> PartialEq for Tolerance<Lhs, Rhs>where
Lhs: ?Sized + EpsTolerance<Rhs> + UlpsTolerance<Rhs>,
Rhs: ?Sized,
EpsToleranceType<Lhs, Rhs>: PartialEq,
UlpsToleranceType<Lhs, Rhs>: PartialEq,
impl<Lhs, Rhs> Copy for Tolerance<Lhs, Rhs>
impl<Lhs, Rhs> Eq for Tolerance<Lhs, Rhs>where
Lhs: ?Sized + EpsTolerance<Rhs> + UlpsTolerance<Rhs>,
Rhs: ?Sized,
EpsToleranceType<Lhs, Rhs>: Eq,
UlpsToleranceType<Lhs, Rhs>: Eq,
Auto Trait Implementations§
impl<Lhs, Rhs> Freeze for Tolerance<Lhs, Rhs>where
<Lhs as EpsTolerance<Rhs>>::T: Freeze,
<Lhs as UlpsTolerance<Rhs>>::T: Freeze,
Lhs: ?Sized,
Rhs: ?Sized,
impl<Lhs, Rhs> RefUnwindSafe for Tolerance<Lhs, Rhs>where
<Lhs as EpsTolerance<Rhs>>::T: RefUnwindSafe,
<Lhs as UlpsTolerance<Rhs>>::T: RefUnwindSafe,
Lhs: ?Sized,
Rhs: ?Sized,
impl<Lhs, Rhs> Send for Tolerance<Lhs, Rhs>where
<Lhs as EpsTolerance<Rhs>>::T: Send,
<Lhs as UlpsTolerance<Rhs>>::T: Send,
Lhs: ?Sized,
Rhs: ?Sized,
impl<Lhs, Rhs> Sync for Tolerance<Lhs, Rhs>where
<Lhs as EpsTolerance<Rhs>>::T: Sync,
<Lhs as UlpsTolerance<Rhs>>::T: Sync,
Lhs: ?Sized,
Rhs: ?Sized,
impl<Lhs, Rhs> Unpin for Tolerance<Lhs, Rhs>where
<Lhs as EpsTolerance<Rhs>>::T: Unpin,
<Lhs as UlpsTolerance<Rhs>>::T: Unpin,
Lhs: ?Sized,
Rhs: ?Sized,
impl<Lhs, Rhs> UnwindSafe for Tolerance<Lhs, Rhs>where
<Lhs as EpsTolerance<Rhs>>::T: UnwindSafe,
<Lhs as UlpsTolerance<Rhs>>::T: UnwindSafe,
Lhs: ?Sized,
Rhs: ?Sized,
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