Trait enso_prelude::Neg1.0.0[][src]

pub trait Neg {
    type Output;
    #[must_use]
    fn neg(self) -> Self::Output;
}
Expand description

The unary negation operator -.

Examples

An implementation of Neg for Sign, which allows the use of - to negate its value.

use std::ops::Neg;

#[derive(Debug, PartialEq)]
enum Sign {
    Negative,
    Zero,
    Positive,
}

impl Neg for Sign {
    type Output = Self;

    fn neg(self) -> Self::Output {
        match self {
            Sign::Negative => Sign::Positive,
            Sign::Zero => Sign::Zero,
            Sign::Positive => Sign::Negative,
        }
    }
}

// A negative positive is a negative.
assert_eq!(-Sign::Positive, Sign::Negative);
// A double negative is a positive.
assert_eq!(-Sign::Negative, Sign::Positive);
// Zero is its own negation.
assert_eq!(-Sign::Zero, Sign::Zero);

Associated Types

type Output[src]

The resulting type after applying the - operator.

Required methods

#[must_use]
fn neg(self) -> Self::Output
[src]

Performs the unary - operation.

Example

let x: i32 = 12;
assert_eq!(-x, -12);

Implementations on Foreign Types

impl Neg for Wrapping<u32>[src]

type Output = Wrapping<u32>

pub fn neg(self) -> Wrapping<u32>[src]

impl Neg for Wrapping<i32>[src]

type Output = Wrapping<i32>

pub fn neg(self) -> Wrapping<i32>[src]

impl Neg for Wrapping<u8>[src]

type Output = Wrapping<u8>

pub fn neg(self) -> Wrapping<u8>[src]

impl Neg for Wrapping<u16>[src]

type Output = Wrapping<u16>

pub fn neg(self) -> Wrapping<u16>[src]

impl<'_> Neg for &'_ f32[src]

type Output = <f32 as Neg>::Output

pub fn neg(self) -> <f32 as Neg>::Output[src]

impl<'_> Neg for &'_ i128[src]

type Output = <i128 as Neg>::Output

pub fn neg(self) -> <i128 as Neg>::Output[src]

impl Neg for Wrapping<i128>[src]

type Output = Wrapping<i128>

pub fn neg(self) -> Wrapping<i128>[src]

impl Neg for i32[src]

type Output = i32

pub fn neg(self) -> i32[src]

impl Neg for Wrapping<i16>[src]

type Output = Wrapping<i16>

pub fn neg(self) -> Wrapping<i16>[src]

impl Neg for Wrapping<i64>[src]

type Output = Wrapping<i64>

pub fn neg(self) -> Wrapping<i64>[src]

impl<'_> Neg for &'_ f64[src]

type Output = <f64 as Neg>::Output

pub fn neg(self) -> <f64 as Neg>::Output[src]

impl<'_> Neg for &'_ i64[src]

type Output = <i64 as Neg>::Output

pub fn neg(self) -> <i64 as Neg>::Output[src]

impl<'_> Neg for &'_ Wrapping<u64>[src]

type Output = <Wrapping<u64> as Neg>::Output

pub fn neg(self) -> <Wrapping<u64> as Neg>::Output[src]

impl<'_> Neg for &'_ Wrapping<i8>[src]

type Output = <Wrapping<i8> as Neg>::Output

pub fn neg(self) -> <Wrapping<i8> as Neg>::Output[src]

impl Neg for Wrapping<u128>[src]

type Output = Wrapping<u128>

pub fn neg(self) -> Wrapping<u128>[src]

impl<'_> Neg for &'_ i32[src]

type Output = <i32 as Neg>::Output

pub fn neg(self) -> <i32 as Neg>::Output[src]

impl Neg for i16[src]

type Output = i16

pub fn neg(self) -> i16[src]

impl Neg for Wrapping<isize>[src]

type Output = Wrapping<isize>

pub fn neg(self) -> Wrapping<isize>[src]

impl<'_> Neg for &'_ Wrapping<i16>[src]

type Output = <Wrapping<i16> as Neg>::Output

pub fn neg(self) -> <Wrapping<i16> as Neg>::Output[src]

impl<'_> Neg for &'_ i16[src]

type Output = <i16 as Neg>::Output

pub fn neg(self) -> <i16 as Neg>::Output[src]

impl Neg for Wrapping<usize>[src]

type Output = Wrapping<usize>

pub fn neg(self) -> Wrapping<usize>[src]

impl<'_> Neg for &'_ Wrapping<u128>[src]

type Output = <Wrapping<u128> as Neg>::Output

pub fn neg(self) -> <Wrapping<u128> as Neg>::Output[src]

impl<'_> Neg for &'_ Wrapping<isize>[src]

type Output = <Wrapping<isize> as Neg>::Output

pub fn neg(self) -> <Wrapping<isize> as Neg>::Output[src]

impl<'_> Neg for &'_ Wrapping<i32>[src]

type Output = <Wrapping<i32> as Neg>::Output

pub fn neg(self) -> <Wrapping<i32> as Neg>::Output[src]

impl<'_> Neg for &'_ isize[src]

type Output = <isize as Neg>::Output

pub fn neg(self) -> <isize as Neg>::Output[src]

impl<'_> Neg for &'_ Wrapping<usize>[src]

type Output = <Wrapping<usize> as Neg>::Output

pub fn neg(self) -> <Wrapping<usize> as Neg>::Output[src]

impl<'_> Neg for &'_ Wrapping<u32>[src]

type Output = <Wrapping<u32> as Neg>::Output

pub fn neg(self) -> <Wrapping<u32> as Neg>::Output[src]

impl Neg for Wrapping<i8>[src]

type Output = Wrapping<i8>

pub fn neg(self) -> Wrapping<i8>[src]

impl<'_> Neg for &'_ Wrapping<u8>[src]

type Output = <Wrapping<u8> as Neg>::Output

pub fn neg(self) -> <Wrapping<u8> as Neg>::Output[src]

impl<'_> Neg for &'_ Wrapping<i64>[src]

type Output = <Wrapping<i64> as Neg>::Output

pub fn neg(self) -> <Wrapping<i64> as Neg>::Output[src]

impl<'_> Neg for &'_ Wrapping<u16>[src]

type Output = <Wrapping<u16> as Neg>::Output

pub fn neg(self) -> <Wrapping<u16> as Neg>::Output[src]

impl Neg for f64[src]

type Output = f64

pub fn neg(self) -> f64[src]

impl Neg for f32[src]

type Output = f32

pub fn neg(self) -> f32[src]

impl Neg for i128[src]

type Output = i128

pub fn neg(self) -> i128[src]

impl Neg for Wrapping<u64>[src]

type Output = Wrapping<u64>

pub fn neg(self) -> Wrapping<u64>[src]

impl Neg for isize[src]

type Output = isize

pub fn neg(self) -> isize[src]

impl<'_> Neg for &'_ Wrapping<i128>[src]

type Output = <Wrapping<i128> as Neg>::Output

pub fn neg(self) -> <Wrapping<i128> as Neg>::Output[src]

impl<'_> Neg for &'_ i8[src]

type Output = <i8 as Neg>::Output

pub fn neg(self) -> <i8 as Neg>::Output[src]

impl Neg for i64[src]

type Output = i64

pub fn neg(self) -> i64[src]

impl Neg for i8[src]

type Output = i8

pub fn neg(self) -> i8[src]

impl<'a> Neg for &'a BigInt[src]

type Output = BigInt

pub fn neg(self) -> BigInt[src]

impl Neg for BigInt[src]

type Output = BigInt

pub fn neg(self) -> BigInt[src]

impl Neg for Sign[src]

pub fn neg(self) -> Sign[src]

Negate Sign value.

type Output = Sign

impl<'a, T> Neg for &'a Complex<T> where
    T: Clone + Num + Neg<Output = T>, 
[src]

type Output = Complex<T>

pub fn neg(self) -> <&'a Complex<T> as Neg>::Output[src]

impl<T> Neg for Complex<T> where
    T: Clone + Num + Neg<Output = T>, 
[src]

type Output = Complex<T>

pub fn neg(self) -> <Complex<T> as Neg>::Output[src]

impl<'a, T> Neg for &'a Ratio<T> where
    T: Clone + Integer + Neg<Output = T>, 
[src]

type Output = Ratio<T>

pub fn neg(self) -> Ratio<T>[src]

impl<T> Neg for Ratio<T> where
    T: Clone + Integer + Neg<Output = T>, 
[src]

type Output = Ratio<T>

pub fn neg(self) -> Ratio<T>[src]

impl<T> Neg for Quaternion<T> where
    T: SimdRealField,
    <T as SimdValue>::Element: SimdRealField, 
[src]

type Output = Quaternion<T>

pub fn neg(self) -> <Quaternion<T> as Neg>::Output[src]

impl<'a, T, const D: usize> Neg for &'a Point<T, D> where
    T: Scalar + ClosedNeg, 
[src]

type Output = Point<T, D>

pub fn neg(self) -> <&'a Point<T, D> as Neg>::Output[src]

impl<'a, T> Neg for &'a Quaternion<T> where
    T: SimdRealField,
    <T as SimdValue>::Element: SimdRealField, 
[src]

type Output = Quaternion<T>

pub fn neg(self) -> <&'a Quaternion<T> as Neg>::Output[src]

impl<T, R, C, S> Neg for Matrix<T, R, C, S> where
    C: Dim,
    T: Scalar + ClosedNeg,
    R: Dim,
    S: Storage<T, R, C>,
    DefaultAllocator: Allocator<T, R, C>, 
[src]

type Output = Matrix<T, R, C, <DefaultAllocator as Allocator<T, R, C>>::Buffer>

pub fn neg(self) -> <Matrix<T, R, C, S> as Neg>::Output[src]

impl<'a, T> Neg for &'a DualQuaternion<T> where
    T: SimdRealField,
    <T as SimdValue>::Element: SimdRealField, 
[src]

type Output = DualQuaternion<T>

pub fn neg(self) -> <&'a DualQuaternion<T> as Neg>::Output[src]

impl<T> Neg for DualQuaternion<T> where
    T: SimdRealField,
    <T as SimdValue>::Element: SimdRealField, 
[src]

type Output = DualQuaternion<T>

pub fn neg(self) -> <DualQuaternion<T> as Neg>::Output[src]

impl<'a, T> Neg for &'a Unit<DualQuaternion<T>> where
    T: SimdRealField,
    <T as SimdValue>::Element: SimdRealField, 
[src]

type Output = Unit<DualQuaternion<T>>

pub fn neg(self) -> <&'a Unit<DualQuaternion<T>> as Neg>::Output[src]

impl<'a, T, R, C, S> Neg for &'a Matrix<T, R, C, S> where
    C: Dim,
    T: Scalar + ClosedNeg,
    R: Dim,
    S: Storage<T, R, C>,
    DefaultAllocator: Allocator<T, R, C>, 
[src]

type Output = Matrix<T, R, C, <DefaultAllocator as Allocator<T, R, C>>::Buffer>

pub fn neg(self) -> <&'a Matrix<T, R, C, S> as Neg>::Output[src]

impl<T, R, C> Neg for Unit<Matrix<T, R, C, <DefaultAllocator as Allocator<T, R, C>>::Buffer>> where
    C: Dim,
    T: Scalar + ClosedNeg,
    R: Dim,
    DefaultAllocator: Allocator<T, R, C>, 
[src]

type Output = Unit<Matrix<T, R, C, <DefaultAllocator as Allocator<T, R, C>>::Buffer>>

pub fn neg(
    self
) -> <Unit<Matrix<T, R, C, <DefaultAllocator as Allocator<T, R, C>>::Buffer>> as Neg>::Output
[src]

impl<T> Neg for Unit<DualQuaternion<T>> where
    T: SimdRealField,
    <T as SimdValue>::Element: SimdRealField, 
[src]

type Output = Unit<DualQuaternion<T>>

pub fn neg(self) -> <Unit<DualQuaternion<T>> as Neg>::Output[src]

impl<T, const D: usize> Neg for Point<T, D> where
    T: Scalar + ClosedNeg, 
[src]

type Output = Point<T, D>

pub fn neg(self) -> <Point<T, D> as Neg>::Output[src]

impl Neg for AutoSimd<[i8; 2]>

type Output = AutoSimd<[i8; 2]>

pub fn neg(self) -> AutoSimd<[i8; 2]>

impl Neg for AutoSimd<[i32; 4]>

type Output = AutoSimd<[i32; 4]>

pub fn neg(self) -> AutoSimd<[i32; 4]>

impl Neg for AutoSimd<[i16; 32]>

type Output = AutoSimd<[i16; 32]>

pub fn neg(self) -> AutoSimd<[i16; 32]>

impl Neg for AutoSimd<[f32; 8]>

type Output = AutoSimd<[f32; 8]>

pub fn neg(self) -> AutoSimd<[f32; 8]>

impl Neg for AutoSimd<[i32; 2]>

type Output = AutoSimd<[i32; 2]>

pub fn neg(self) -> AutoSimd<[i32; 2]>

impl Neg for AutoSimd<[i32; 16]>

type Output = AutoSimd<[i32; 16]>

pub fn neg(self) -> AutoSimd<[i32; 16]>

impl Neg for AutoSimd<[f64; 8]>

type Output = AutoSimd<[f64; 8]>

pub fn neg(self) -> AutoSimd<[f64; 8]>

impl Neg for AutoSimd<[f64; 2]>

type Output = AutoSimd<[f64; 2]>

pub fn neg(self) -> AutoSimd<[f64; 2]>

impl Neg for AutoSimd<[i8; 8]>

type Output = AutoSimd<[i8; 8]>

pub fn neg(self) -> AutoSimd<[i8; 8]>

impl Neg for AutoSimd<[i16; 16]>

type Output = AutoSimd<[i16; 16]>

pub fn neg(self) -> AutoSimd<[i16; 16]>

impl Neg for AutoSimd<[f32; 4]>

type Output = AutoSimd<[f32; 4]>

pub fn neg(self) -> AutoSimd<[f32; 4]>

impl Neg for AutoSimd<[f64; 4]>

type Output = AutoSimd<[f64; 4]>

pub fn neg(self) -> AutoSimd<[f64; 4]>

impl Neg for AutoSimd<[i16; 8]>

type Output = AutoSimd<[i16; 8]>

pub fn neg(self) -> AutoSimd<[i16; 8]>

impl Neg for AutoSimd<[f32; 2]>

type Output = AutoSimd<[f32; 2]>

pub fn neg(self) -> AutoSimd<[f32; 2]>

impl Neg for AutoSimd<[i128; 4]>

type Output = AutoSimd<[i128; 4]>

pub fn neg(self) -> AutoSimd<[i128; 4]>

impl Neg for AutoSimd<[i32; 8]>

type Output = AutoSimd<[i32; 8]>

pub fn neg(self) -> AutoSimd<[i32; 8]>

impl Neg for AutoSimd<[i8; 32]>

type Output = AutoSimd<[i8; 32]>

pub fn neg(self) -> AutoSimd<[i8; 32]>

impl Neg for AutoSimd<[isize; 4]>

type Output = AutoSimd<[isize; 4]>

pub fn neg(self) -> AutoSimd<[isize; 4]>

impl Neg for AutoSimd<[i8; 4]>

type Output = AutoSimd<[i8; 4]>

pub fn neg(self) -> AutoSimd<[i8; 4]>

impl Neg for AutoSimd<[i16; 4]>

type Output = AutoSimd<[i16; 4]>

pub fn neg(self) -> AutoSimd<[i16; 4]>

impl Neg for AutoSimd<[i16; 2]>

type Output = AutoSimd<[i16; 2]>

pub fn neg(self) -> AutoSimd<[i16; 2]>

impl Neg for AutoSimd<[i128; 1]>

type Output = AutoSimd<[i128; 1]>

pub fn neg(self) -> AutoSimd<[i128; 1]>

impl Neg for AutoSimd<[i64; 2]>

type Output = AutoSimd<[i64; 2]>

pub fn neg(self) -> AutoSimd<[i64; 2]>

impl Neg for AutoSimd<[i128; 2]>

type Output = AutoSimd<[i128; 2]>

pub fn neg(self) -> AutoSimd<[i128; 2]>

impl Neg for AutoSimd<[i64; 4]>

type Output = AutoSimd<[i64; 4]>

pub fn neg(self) -> AutoSimd<[i64; 4]>

impl Neg for AutoSimd<[i8; 16]>

type Output = AutoSimd<[i8; 16]>

pub fn neg(self) -> AutoSimd<[i8; 16]>

impl Neg for AutoSimd<[isize; 8]>

type Output = AutoSimd<[isize; 8]>

pub fn neg(self) -> AutoSimd<[isize; 8]>

impl Neg for AutoSimd<[f32; 16]>

type Output = AutoSimd<[f32; 16]>

pub fn neg(self) -> AutoSimd<[f32; 16]>

impl Neg for AutoSimd<[isize; 2]>

type Output = AutoSimd<[isize; 2]>

pub fn neg(self) -> AutoSimd<[isize; 2]>

impl Neg for AutoSimd<[i64; 8]>

type Output = AutoSimd<[i64; 8]>

pub fn neg(self) -> AutoSimd<[i64; 8]>

impl<T> Neg for Complex<T> where
    T: Clone + Num + Neg<Output = T>, 
[src]

type Output = Complex<T>

pub fn neg(self) -> <Complex<T> as Neg>::Output[src]

impl<'a, T> Neg for &'a Complex<T> where
    T: Clone + Num + Neg<Output = T>, 
[src]

type Output = Complex<T>

pub fn neg(self) -> <&'a Complex<T> as Neg>::Output[src]

impl<U> Neg for PInt<U> where
    U: Unsigned + NonZero, 

-PInt = NInt

type Output = NInt<U>

pub fn neg(self) -> <PInt<U> as Neg>::Output

impl<U> Neg for NInt<U> where
    U: Unsigned + NonZero, 

-NInt = PInt

type Output = PInt<U>

pub fn neg(self) -> <NInt<U> as Neg>::Output

impl<V, A> Neg for TArr<V, A> where
    V: Neg,
    A: Neg

type Output = TArr<<V as Neg>::Output, <A as Neg>::Output>

pub fn neg(self) -> <TArr<V, A> as Neg>::Output

impl Neg for Z0

-Z0 = Z0

type Output = Z0

pub fn neg(self) -> <Z0 as Neg>::Output

impl Neg for ATerm

type Output = ATerm

pub fn neg(self) -> <ATerm as Neg>::Output

impl<T> Neg for Ratio<T> where
    T: Clone + Integer + Neg<Output = T>, 
[src]

type Output = Ratio<T>

pub fn neg(self) -> Ratio<T>[src]

impl<'a, T> Neg for &'a Ratio<T> where
    T: Clone + Integer + Neg<Output = T>, 
[src]

type Output = Ratio<T>

pub fn neg(self) -> Ratio<T>[src]

Implementors