Skip to main content

StrictAbs

Trait StrictAbs 

Source
pub trait StrictAbs: Sized {
    type Output;

    // Required method
    fn strict_abs(self) -> Self::Output;
}
Expand description

Computes the absolute value, panicking on overflow even in release builds.

Required Associated Types§

Source

type Output

The result type (Self for the primitive impls).

Required Methods§

Source

fn strict_abs(self) -> Self::Output

Strict absolute value. Computes self.abs(), panicking for MIN.strict_abs() (the result can’t be represented).

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl StrictAbs for i8

Source§

type Output = i8

Source§

fn strict_abs(self) -> Self

Source§

impl StrictAbs for i16

Source§

type Output = i16

Source§

fn strict_abs(self) -> Self

Source§

impl StrictAbs for i32

Source§

type Output = i32

Source§

fn strict_abs(self) -> Self

Source§

impl StrictAbs for i64

Source§

type Output = i64

Source§

fn strict_abs(self) -> Self

Source§

impl StrictAbs for i128

Source§

type Output = i128

Source§

fn strict_abs(self) -> Self

Source§

impl StrictAbs for isize

Source§

type Output = isize

Source§

fn strict_abs(self) -> Self

Implementors§