pub trait ApproxEq<Eps> {
    // Required methods
    fn approx_epsilon() -> Eps;
    fn approx_eq_eps(&self, other: &Self, approx_epsilon: &Eps) -> bool;

    // Provided method
    fn approx_eq(&self, other: &Self) -> bool { ... }
}
Available on crate feature canvas only.
Expand description

Trait for testing approximate equality

Required Methods§

fn approx_epsilon() -> Eps

Default epsilon value

fn approx_eq_eps(&self, other: &Self, approx_epsilon: &Eps) -> bool

Returns true is this object is approximately equal to the other one, using a provided epsilon value.

Provided Methods§

fn approx_eq(&self, other: &Self) -> bool

Returns true is this object is approximately equal to the other one, using the approx_epsilon() epsilon value.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

§

impl ApproxEq<f32> for f32

§

fn approx_epsilon() -> f32

§

fn approx_eq_eps(&self, other: &f32, approx_epsilon: &f32) -> bool

§

impl ApproxEq<f64> for f64

§

fn approx_epsilon() -> f64

§

fn approx_eq_eps(&self, other: &f64, approx_epsilon: &f64) -> bool

Implementors§

§

impl<T> ApproxEq<T> for Angle<T>
where T: ApproxEq<T>,

§

impl<T, Src, Dst> ApproxEq<T> for Rotation3D<T, Src, Dst>
where T: Copy + Neg<Output = T> + ApproxEq<T>,

§

impl<T, Src, Dst> ApproxEq<T> for Transform2D<T, Src, Dst>
where T: ApproxEq<T>,

§

impl<T, Src, Dst> ApproxEq<T> for Transform3D<T, Src, Dst>
where T: ApproxEq<T>,

§

impl<T, U> ApproxEq<Point2D<T, U>> for Point2D<T, U>
where T: ApproxEq<T>,

§

impl<T, U> ApproxEq<Point3D<T, U>> for Point3D<T, U>
where T: ApproxEq<T>,

§

impl<T, U> ApproxEq<Vector2D<T, U>> for Vector2D<T, U>
where T: ApproxEq<T>,

§

impl<T, U> ApproxEq<Vector3D<T, U>> for Vector3D<T, U>
where T: ApproxEq<T>,

§

impl<U, T> ApproxEq<T> for Length<T, U>
where T: ApproxEq<T>,