Trait decorum::FloatProxy
[−]
[src]
pub trait FloatProxy<T>: Sized where
T: Float + Primitive, { fn from_inner(value: T) -> Self; fn into_inner(self) -> T; }
A floating-point proxy.
This trait allows code to be generic over proxy types and exposes functions for converting primitives to and from a proxy.
This would typically be used along with other bounds, such as Eq + FloatProxy<T> + Hash
or FloatProxy<T> + Real
.
It is not necessary to import this trait to use these functions; because it would be burdensome to import this every time a proxy is used, the trait implementation simply forwards calls to functions directly associated with the type.
Required Methods
fn from_inner(value: T) -> Self
Converts a primitive into a floating-point proxy.
Panics
This function will panic if the primitive value is not allowed by the contraints of the proxy.
fn into_inner(self) -> T
Converts the float proxy into a primitive value.