Abs

Trait Abs 

Source
pub trait Abs {
    // Required method
    fn abs(&self) -> Self;
}
Expand description

A type that can have its absolute difference from zero calculated.

Required Methods§

Source

fn abs(&self) -> Self

Returns the positive difference between this value and 0.

This function should never panic and always perform a saturating absolute value calculation.

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 Abs for f32

Source§

fn abs(&self) -> Self

Source§

impl Abs for i8

Source§

fn abs(&self) -> Self

Source§

impl Abs for i16

Source§

fn abs(&self) -> Self

Source§

impl Abs for i32

Source§

fn abs(&self) -> Self

Source§

impl Abs for i64

Source§

fn abs(&self) -> Self

Source§

impl Abs for i128

Source§

fn abs(&self) -> Self

Source§

impl Abs for isize

Source§

fn abs(&self) -> Self

Implementors§

Source§

impl Abs for Lp

Source§

impl Abs for Px

Source§

impl<Unit> Abs for Point<Unit>
where Unit: Abs,

Source§

impl<Unit> Abs for Size<Unit>
where Unit: Abs,