Trait float_eq::AssertFloatEqAll
source · [−]pub trait AssertFloatEqAll<Rhs: ?Sized = Self>: FloatEqAll<Rhs> {
type AllDebugTol: Debug + FloatEqUlpsTol;
fn debug_abs_all_tol(
&self,
other: &Rhs,
tol: &Self::AllTol
) -> Self::AllDebugTol;
fn debug_rmax_all_tol(
&self,
other: &Rhs,
tol: &Self::AllTol
) -> Self::AllDebugTol;
fn debug_rmin_all_tol(
&self,
other: &Rhs,
tol: &Self::AllTol
) -> Self::AllDebugTol;
fn debug_r1st_all_tol(
&self,
other: &Rhs,
tol: &Self::AllTol
) -> Self::AllDebugTol;
fn debug_r2nd_all_tol(
&self,
other: &Rhs,
tol: &Self::AllTol
) -> Self::AllDebugTol;
fn debug_ulps_all_tol(
&self,
other: &Rhs,
tol: &UlpsTol<Self::AllTol>
) -> UlpsTol<Self::AllDebugTol>
where
UlpsTol<Self::AllDebugTol>: Sized;
fn debug_rel_all_tol(
&self,
other: &Rhs,
tol: &Self::AllTol
) -> Self::AllDebugTol { ... }
}
Expand description
Debug context for when an assert using an all
check fails.
This trait is used by assert_float_eq!
and assert_float_ne!
.
To implement this trait over a new type, see How to compare custom types.
Required Associated Types
type AllDebugTol: Debug + FloatEqUlpsTol
type AllDebugTol: Debug + FloatEqUlpsTol
Displayed to the user when an assert fails, using fmt::Debug
.
This should match the fields of the the most complex type in the comparison.
Required Methods
fn debug_abs_all_tol(&self, other: &Rhs, tol: &Self::AllTol) -> Self::AllDebugTol
fn debug_abs_all_tol(&self, other: &Rhs, tol: &Self::AllTol) -> Self::AllDebugTol
The tolerance used by an abs_all
comparison, displayed when an assert fails.
fn debug_rmax_all_tol(&self, other: &Rhs, tol: &Self::AllTol) -> Self::AllDebugTol
fn debug_rmax_all_tol(&self, other: &Rhs, tol: &Self::AllTol) -> Self::AllDebugTol
The tolerance used by an rmax_all
comparison, displayed when an assert fails.
Returns tol
scaled by the magnitude of the larger operand.
fn debug_rmin_all_tol(&self, other: &Rhs, tol: &Self::AllTol) -> Self::AllDebugTol
fn debug_rmin_all_tol(&self, other: &Rhs, tol: &Self::AllTol) -> Self::AllDebugTol
The tolerance used by an rmin_all
comparison, displayed when an assert fails.
Returns tol
scaled by the magnitude of the smaller operand.
fn debug_r1st_all_tol(&self, other: &Rhs, tol: &Self::AllTol) -> Self::AllDebugTol
fn debug_r1st_all_tol(&self, other: &Rhs, tol: &Self::AllTol) -> Self::AllDebugTol
The tolerance used by an r1st_all
comparison, displayed
when an assert fails.
Returns tol
scaled by the magnitude of the first operand.
fn debug_r2nd_all_tol(&self, other: &Rhs, tol: &Self::AllTol) -> Self::AllDebugTol
fn debug_r2nd_all_tol(&self, other: &Rhs, tol: &Self::AllTol) -> Self::AllDebugTol
The tolerance used by an r2nd_all
comparison, displayed when an assert fails.
Returns tol
scaled by the magnitude of the second operand.
fn debug_ulps_all_tol(
&self,
other: &Rhs,
tol: &UlpsTol<Self::AllTol>
) -> UlpsTol<Self::AllDebugTol> where
UlpsTol<Self::AllDebugTol>: Sized,
fn debug_ulps_all_tol(
&self,
other: &Rhs,
tol: &UlpsTol<Self::AllTol>
) -> UlpsTol<Self::AllDebugTol> where
UlpsTol<Self::AllDebugTol>: Sized,
The tolerance used by an ulps_all
comparison, displayed when an assert fails.
Provided Methods
fn debug_rel_all_tol(&self, other: &Rhs, tol: &Self::AllTol) -> Self::AllDebugTol
fn debug_rel_all_tol(&self, other: &Rhs, tol: &Self::AllTol) -> Self::AllDebugTol
The tolerance used by a rel_all
comparison, displayed when an assert fails.
Equivalent to self.debug_rmax_all_tol(self, other, tol)
, there
is no need to reimplement this for your own types.