Trait CheckedNeg

Source
pub trait CheckedNeg {
    type Output;

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

Negates a number, returning None if the result is not representable.

Required Associated Types§

Required Methods§

Source

fn checked_neg(self) -> Option<Self::Output>

Implementations on Foreign Types§

Source§

impl CheckedNeg for i8

Source§

fn checked_neg(self) -> Option<i8>

This is a wrapper over the checked_neg functions in the standard library, for example this one.

Source§

type Output = i8

Source§

impl CheckedNeg for i16

Source§

fn checked_neg(self) -> Option<i16>

This is a wrapper over the checked_neg functions in the standard library, for example this one.

Source§

type Output = i16

Source§

impl CheckedNeg for i32

Source§

fn checked_neg(self) -> Option<i32>

This is a wrapper over the checked_neg functions in the standard library, for example this one.

Source§

type Output = i32

Source§

impl CheckedNeg for i64

Source§

fn checked_neg(self) -> Option<i64>

This is a wrapper over the checked_neg functions in the standard library, for example this one.

Source§

type Output = i64

Source§

impl CheckedNeg for i128

Source§

fn checked_neg(self) -> Option<i128>

This is a wrapper over the checked_neg functions in the standard library, for example this one.

Source§

type Output = i128

Source§

impl CheckedNeg for isize

Source§

fn checked_neg(self) -> Option<isize>

This is a wrapper over the checked_neg functions in the standard library, for example this one.

Source§

type Output = isize

Source§

impl CheckedNeg for u8

Source§

fn checked_neg(self) -> Option<u8>

This is a wrapper over the checked_neg functions in the standard library, for example this one.

Source§

type Output = u8

Source§

impl CheckedNeg for u16

Source§

fn checked_neg(self) -> Option<u16>

This is a wrapper over the checked_neg functions in the standard library, for example this one.

Source§

type Output = u16

Source§

impl CheckedNeg for u32

Source§

fn checked_neg(self) -> Option<u32>

This is a wrapper over the checked_neg functions in the standard library, for example this one.

Source§

type Output = u32

Source§

impl CheckedNeg for u64

Source§

fn checked_neg(self) -> Option<u64>

This is a wrapper over the checked_neg functions in the standard library, for example this one.

Source§

type Output = u64

Source§

impl CheckedNeg for u128

Source§

fn checked_neg(self) -> Option<u128>

This is a wrapper over the checked_neg functions in the standard library, for example this one.

Source§

type Output = u128

Source§

impl CheckedNeg for usize

Source§

fn checked_neg(self) -> Option<usize>

This is a wrapper over the checked_neg functions in the standard library, for example this one.

Source§

type Output = usize

Implementors§