pub trait ConvAsUtil<Dst> {
// Provided methods
fn approx(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst> { ... }
fn approx_by<Scheme>(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst, Scheme>,
Scheme: ApproxScheme { ... }
}
Expand description
This extension trait exists to simplify using various conversions.
If there is more than one ApproxFrom
implementation for a given type, a simple call to approx_into
may not be uniquely resolvable. Due to the position of the scheme parameter (on the trait itself), it is cumbersome to specify which scheme you wanted.
The destination type is inferred from context.
See also the ConvUtil
trait.
Note: There appears to be a bug in
rustdoc
’s output. This trait is implemented for all types, though the methods are only available for types where the appropriate conversions are defined.
Provided Methods§
Sourcefn approx(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
fn approx(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
Approximate the subject with the default scheme.