Skip to main content

UnsignedAbs

Trait UnsignedAbs 

Source
pub trait UnsignedAbs {
    type Output;

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

Unsigned absolute value.

§Examples

assert_eq!((-5i8).unsigned_abs(), 5u8);

Required Associated Types§

Source

type Output

The type of the unsigned absolute value.

Required Methods§

Source

fn unsigned_abs(self) -> Self::Output

Compute the absolute value as an unsigned type.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl UnsignedAbs for i8

Source§

impl UnsignedAbs for i16

Source§

impl UnsignedAbs for i32

Source§

impl UnsignedAbs for i64

Source§

impl UnsignedAbs for i128

Source§

impl UnsignedAbs for isize

Implementors§