1.0.0[−][src]Trait geng::prelude::Neg
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
The resulting type after applying the -
operator.
Required methods
Loading content...Implementations on Foreign Types
impl Neg for f64
[src]
impl<'_> Neg for &'_ Wrapping<u32>
[src]
impl Neg for Wrapping<i32>
[src]
impl Neg for i32
[src]
impl Neg for Wrapping<i8>
[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<usize>
[src]
type Output = <Wrapping<usize> as Neg>::Output
pub fn neg(self) -> <Wrapping<usize> as Neg>::Output
[src]
impl<'_> Neg for &'_ i16
[src]
impl Neg for Wrapping<i16>
[src]
impl<'_> Neg for &'_ i64
[src]
impl<'_> Neg for &'_ Wrapping<i8>
[src]
impl<'_> Neg for &'_ isize
[src]
impl Neg for Wrapping<u16>
[src]
impl Neg for Wrapping<i64>
[src]
impl Neg for Wrapping<u64>
[src]
impl Neg for f32
[src]
impl<'_> Neg for &'_ Wrapping<u64>
[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<isize>
[src]
impl<'_> Neg for &'_ i32
[src]
impl Neg for i128
[src]
impl Neg for isize
[src]
impl Neg for Wrapping<i128>
[src]
impl<'_> Neg for &'_ i8
[src]
impl<'_> Neg for &'_ Wrapping<i16>
[src]
impl<'_> Neg for &'_ i128
[src]
impl<'_> Neg for &'_ Wrapping<u8>
[src]
impl Neg for Wrapping<u128>
[src]
impl<'_> Neg for &'_ Wrapping<i64>
[src]
impl<'_> Neg for &'_ Wrapping<u16>
[src]
impl<'_> Neg for &'_ f64
[src]
impl<'_> Neg for &'_ f32
[src]
impl Neg for i8
[src]
impl Neg for Wrapping<usize>
[src]
impl Neg for Wrapping<u32>
[src]
impl<'_> Neg for &'_ Wrapping<i32>
[src]
impl Neg for i16
[src]
impl Neg for i64
[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 Wrapping<u8>
[src]
impl Neg for Duration
[src]
impl Neg for TimeVal
impl Neg for TimeSpec
impl<'a, T> Neg for &'a Ratio<T> where
T: Clone + Integer + Neg<Output = T>,
[src]
T: Clone + Integer + Neg<Output = T>,
impl<T> Neg for Ratio<T> where
T: Clone + Integer + Neg<Output = T>,
[src]
T: Clone + Integer + Neg<Output = T>,
impl<U> Neg for PInt<U> where
U: NonZero + Unsigned,
U: NonZero + Unsigned,
-PInt = NInt
impl Neg for Z0
-Z0 = Z0
impl Neg for ATerm
impl<V, A> Neg for TArr<V, A> where
A: Neg,
V: Neg,
A: Neg,
V: Neg,
type Output = TArr<<V as Neg>::Output, <A as Neg>::Output>
pub fn neg(self) -> <TArr<V, A> as Neg>::Output
impl<U> Neg for NInt<U> where
U: NonZero + Unsigned,
U: NonZero + Unsigned,
-NInt = PInt
impl Neg for TimeVal
impl Neg for TimeSpec
Loading content...Implementors
impl<T> Neg for Mat4<T> where
T: Num<Output = T> + Copy + Neg,
[src]
T: Num<Output = T> + Copy + Neg,
impl<T> Neg for Quat<T> where
T: Neg<Output = T>,
[src]
T: Neg<Output = T>,
impl<T> Neg for RealImpl<T> where
T: Float,
[src]
T: Float,
impl<T> Neg for Vec2<T> where
T: Neg<Output = T>,
[src]
T: Neg<Output = T>,
impl<T> Neg for Vec3<T> where
T: Neg<Output = T>,
[src]
T: Neg<Output = T>,
impl<T> Neg for Vec4<T> where
T: Neg<Output = T>,
[src]
T: Neg<Output = T>,