euclid::num

Trait Round

Source
pub trait Round: Copy {
    // Required method
    fn round(self) -> Self;
}
Expand description

Defines the nearest integer value to the original value.

Required Methods§

Source

fn round(self) -> Self

Rounds to the nearest integer value.

This behavior is preserved for negative values (unlike the basic cast).

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.

Implementations on Foreign Types§

Source§

impl Round for f32

Source§

fn round(self) -> f32

Source§

impl Round for f64

Source§

fn round(self) -> f64

Source§

impl Round for i16

Source§

fn round(self) -> i16

Source§

impl Round for i32

Source§

fn round(self) -> i32

Source§

impl Round for i64

Source§

fn round(self) -> i64

Source§

impl Round for isize

Source§

fn round(self) -> isize

Source§

impl Round for u16

Source§

fn round(self) -> u16

Source§

impl Round for u32

Source§

fn round(self) -> u32

Source§

impl Round for u64

Source§

fn round(self) -> u64

Source§

impl Round for usize

Source§

fn round(self) -> usize

Implementors§

Source§

impl<T: Round, U> Round for Point2D<T, U>

Source§

impl<T: Round, U> Round for Point3D<T, U>

Source§

impl<T: Round, U> Round for Size2D<T, U>

Source§

impl<T: Round, U> Round for Size3D<T, U>

Source§

impl<T: Round, U> Round for Vector2D<T, U>

Source§

impl<T: Round, U> Round for Vector3D<T, U>