pub trait Rounding: Copy + Default {
type MaximumError: From<Infallible> + Into<Error> + Error;
}Expand description
Rounding mode
Implementations of this trait are (probably) unit structs, used to mark the type of rounding used at the type level.
§Implied implementations
impl<S, T: ConvExact<S>> ConvTo<S, R> is
is implemented for each rounding mode R provided by this crate since a
more general impl over R: Rounding is not compatible with the wider trait
design under the limitations of Rust’s current trait solver. Any rounding
mode added by a third-party crate should therefore provide a similar impl.
Required Associated Types§
Sourcetype MaximumError: From<Infallible> + Into<Error> + Error
type MaximumError: From<Infallible> + Into<Error> + Error
Maximum error type
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
Source§impl Rounding for Approx
impl Rounding for Approx
type MaximumError = RangeError
Source§impl Rounding for Ceil
Available on crate features libm or std only.
impl Rounding for Ceil
Available on crate features
libm or std only.type MaximumError = RangeError
Source§impl Rounding for Floor
Available on crate features libm or std only.
impl Rounding for Floor
Available on crate features
libm or std only.type MaximumError = RangeError
Source§impl Rounding for Nearest
Available on crate features libm or std only.
impl Rounding for Nearest
Available on crate features
libm or std only.