pub trait Approx: Sized {
type Approximation;
type Cache: Default;
// Required method
fn approx_with_cache(
self,
tolerance: impl Into<Tolerance>,
cache: &mut Self::Cache,
core: &mut Core,
) -> Self::Approximation;
// Provided method
fn approx(
self,
tolerance: impl Into<Tolerance>,
core: &mut Core,
) -> Self::Approximation { ... }
}
Expand description
Approximate an object
Required Associated Types§
Sourcetype Approximation
type Approximation
The approximation of the object
Required Methods§
Sourcefn approx_with_cache(
self,
tolerance: impl Into<Tolerance>,
cache: &mut Self::Cache,
core: &mut Core,
) -> Self::Approximation
fn approx_with_cache( self, tolerance: impl Into<Tolerance>, cache: &mut Self::Cache, core: &mut Core, ) -> Self::Approximation
Approximate the object, using the provided cache
This is a lower-level method that allows some degree of control over
caching. Callers might consider using Approx::approx
instead.
Provided Methods§
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.