Skip to main content

Rounding

Trait Rounding 

Source
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§

Source

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

Source§

impl Rounding for Ceil

Available on crate features libm or std only.
Source§

impl Rounding for Exact

Source§

impl Rounding for Floor

Available on crate features libm or std only.
Source§

impl Rounding for Nearest

Available on crate features libm or std only.
Source§

impl Rounding for Trunc