pub trait Approx {
// Required method
fn approx_distance_to(&self, other: &Self) -> f32;
// Provided methods
fn approx_eq(&self, other: &Self) -> bool { ... }
fn approx_eq_eps(&self, other: &Self, eps: f32) -> bool { ... }
}
Expand description
Implement this for types you want to check for approximate equality
Required Methods§
Sourcefn approx_distance_to(&self, other: &Self) -> f32
fn approx_distance_to(&self, other: &Self) -> f32
Get an approximated distance between two values
Provided Methods§
Sourcefn approx_eq(&self, other: &Self) -> bool
fn approx_eq(&self, other: &Self) -> bool
Check if values are approximately equal using DEFAULT_EPS
Sourcefn approx_eq_eps(&self, other: &Self, eps: f32) -> bool
fn approx_eq_eps(&self, other: &Self, eps: f32) -> bool
Check if values are approximately equal using supplied eps 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.