pub trait AssertFloatEqAll<Rhs: ?Sized = Self>: FloatEqAll<Rhs> {
type AllDebugTol: Debug + FloatEqUlpsTol;
// Required methods
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;
// Provided method
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§
Sourcetype 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§
Sourcefn 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.
Sourcefn 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.
Sourcefn 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.
Sourcefn 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.
Sourcefn 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.
Sourcefn debug_ulps_all_tol(
&self,
other: &Rhs,
tol: &UlpsTol<Self::AllTol>,
) -> UlpsTol<Self::AllDebugTol>
fn debug_ulps_all_tol( &self, other: &Rhs, tol: &UlpsTol<Self::AllTol>, ) -> UlpsTol<Self::AllDebugTol>
The tolerance used by an ulps_all comparison, displayed when an assert fails.
Provided Methods§
Sourcefn 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.