Trait enso_flexer::prelude::logger::prelude::Neg 1.0.0[−][src]
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
Loading content...Required methods
Loading content...Implementations on Foreign Types
impl<'a, N> Neg for &'a Quaternion<N> where
N: SimdRealField,
<N as SimdValue>::Element: SimdRealField,
[src]
impl<'a, N> Neg for &'a Quaternion<N> where
N: SimdRealField,
<N as SimdValue>::Element: SimdRealField,
[src]impl<N, D> Neg for Point<N, D> where
N: Scalar + ClosedNeg,
D: DimName,
DefaultAllocator: Allocator<N, D, U1>,
[src]
impl<N, D> Neg for Point<N, D> where
N: Scalar + ClosedNeg,
D: DimName,
DefaultAllocator: Allocator<N, D, U1>,
[src]impl<N, R, C> Neg for Unit<Matrix<N, R, C, <DefaultAllocator as Allocator<N, R, C>>::Buffer>> where
C: Dim,
R: Dim,
N: Scalar + ClosedNeg,
DefaultAllocator: Allocator<N, R, C>,
[src]
impl<N, R, C> Neg for Unit<Matrix<N, R, C, <DefaultAllocator as Allocator<N, R, C>>::Buffer>> where
C: Dim,
R: Dim,
N: Scalar + ClosedNeg,
DefaultAllocator: Allocator<N, R, C>,
[src]impl<'a, N, D> Neg for &'a Point<N, D> where
N: Scalar + ClosedNeg,
D: DimName,
DefaultAllocator: Allocator<N, D, U1>,
[src]
impl<'a, N, D> Neg for &'a Point<N, D> where
N: Scalar + ClosedNeg,
D: DimName,
DefaultAllocator: Allocator<N, D, U1>,
[src]impl<N, R, C, S> Neg for Matrix<N, R, C, S> where
C: Dim,
R: Dim,
S: Storage<N, R, C>,
N: Scalar + ClosedNeg,
DefaultAllocator: Allocator<N, R, C>,
[src]
impl<N, R, C, S> Neg for Matrix<N, R, C, S> where
C: Dim,
R: Dim,
S: Storage<N, R, C>,
N: Scalar + ClosedNeg,
DefaultAllocator: Allocator<N, R, C>,
[src]impl<'a, N, R, C, S> Neg for &'a Matrix<N, R, C, S> where
C: Dim,
R: Dim,
S: Storage<N, R, C>,
N: Scalar + ClosedNeg,
DefaultAllocator: Allocator<N, R, C>,
[src]
impl<'a, N, R, C, S> Neg for &'a Matrix<N, R, C, S> where
C: Dim,
R: Dim,
S: Storage<N, R, C>,
N: Scalar + ClosedNeg,
DefaultAllocator: Allocator<N, R, C>,
[src]impl<N> Neg for Quaternion<N> where
N: SimdRealField,
<N as SimdValue>::Element: SimdRealField,
[src]
impl<N> Neg for Quaternion<N> where
N: SimdRealField,
<N as SimdValue>::Element: SimdRealField,
[src]impl<U> Neg for NInt<U> where
U: Unsigned + NonZero,
impl<U> Neg for NInt<U> where
U: Unsigned + NonZero,
-NInt = PInt
impl<U> Neg for PInt<U> where
U: Unsigned + NonZero,
impl<U> Neg for PInt<U> where
U: Unsigned + NonZero,
-PInt = NInt