euclid::approxeq

Trait ApproxEq

Source
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 { ... }
}
Expand description

Trait for testing approximate equality

Required Methods§

Source

fn approx_epsilon() -> Eps

Default epsilon value

Source

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§

Source

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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl ApproxEq<f32> for f32

Source§

fn approx_epsilon() -> f32

Source§

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

Source§

impl ApproxEq<f64> for f64

Source§

fn approx_epsilon() -> f64

Source§

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

Implementors§

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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

Source§

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