Skip to main content

StrictAbs

Trait StrictAbs 

Source
pub trait StrictAbs: Sized + Neg {
    // Required method
    fn strict_abs(self) -> <Self as Neg>::Output;
}
Expand description

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

Required Methods§

Source

fn strict_abs(self) -> <Self as Neg>::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§

fn strict_abs(self) -> Self

Source§

impl StrictAbs for i16

Source§

fn strict_abs(self) -> Self

Source§

impl StrictAbs for i32

Source§

fn strict_abs(self) -> Self

Source§

impl StrictAbs for i64

Source§

fn strict_abs(self) -> Self

Source§

impl StrictAbs for i128

Source§

fn strict_abs(self) -> Self

Source§

impl StrictAbs for isize

Source§

fn strict_abs(self) -> Self

Implementors§