devela::_dep::bytemuck::__core::ops

Trait Neg

1.6.0 · Source
pub trait Neg {
    type Output;

    // Required method
    fn neg(self) -> Self::Output;
}
Available on crate feature dep_bytemuck only.
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);

Required Associated Types§

1.0.0 · Source

type Output

The resulting type after applying the - operator.

Required Methods§

1.0.0 · Source

fn neg(self) -> Self::Output

Performs the unary - operation.

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

Implementors§

1.0.0 · Source§

impl Neg for &f16

1.0.0 · Source§

impl Neg for &f32

1.0.0 · Source§

impl Neg for &f64

1.0.0 · Source§

impl Neg for &f128

1.0.0 · Source§

impl Neg for &i8

1.0.0 · Source§

impl Neg for &i16

1.0.0 · Source§

impl Neg for &i32

1.0.0 · Source§

impl Neg for &i64

1.0.0 · Source§

impl Neg for &i128

1.0.0 · Source§

impl Neg for &isize

1.71.0 · Source§

impl Neg for &NonZero<i8>

1.71.0 · Source§

impl Neg for &NonZero<i16>

1.71.0 · Source§

impl Neg for &NonZero<i32>

1.71.0 · Source§

impl Neg for &NonZero<i64>

1.71.0 · Source§

impl Neg for &NonZero<i128>

1.71.0 · Source§

impl Neg for &NonZero<isize>

1.74.0 · Source§

impl Neg for &Saturating<i8>

1.74.0 · Source§

impl Neg for &Saturating<i16>

1.74.0 · Source§

impl Neg for &Saturating<i32>

1.74.0 · Source§

impl Neg for &Saturating<i64>

1.74.0 · Source§

impl Neg for &Saturating<i128>

1.74.0 · Source§

impl Neg for &Saturating<isize>

1.14.0 · Source§

impl Neg for &Wrapping<i8>

1.14.0 · Source§

impl Neg for &Wrapping<i16>

1.14.0 · Source§

impl Neg for &Wrapping<i32>

1.14.0 · Source§

impl Neg for &Wrapping<i64>

1.14.0 · Source§

impl Neg for &Wrapping<i128>

1.14.0 · Source§

impl Neg for &Wrapping<isize>

1.14.0 · Source§

impl Neg for &Wrapping<u8>

1.14.0 · Source§

impl Neg for &Wrapping<u16>

1.14.0 · Source§

impl Neg for &Wrapping<u32>

1.14.0 · Source§

impl Neg for &Wrapping<u64>

1.14.0 · Source§

impl Neg for &Wrapping<u128>

1.14.0 · Source§

impl Neg for &Wrapping<usize>

Source§

impl Neg for &BigInt

Source§

impl Neg for &Number

Source§

impl Neg for &JsValue

§

impl Neg for &f32x4

§

impl Neg for &f32x8

§

impl Neg for &f64x2

§

impl Neg for &f64x4

§

impl Neg for &i8x16

§

impl Neg for &i8x32

§

impl Neg for &i16x8

§

impl Neg for &i16x16

§

impl Neg for &i32x4

§

impl Neg for &i32x8

§

impl Neg for &i64x2

§

impl Neg for &i64x4

§

impl Neg for &u8x16

§

impl Neg for &u16x8

§

impl Neg for &u32x4

§

impl Neg for &u32x8

§

impl Neg for &u64x2

§

impl Neg for &u64x4

Source§

impl Neg for &Vec3A

Source§

impl Neg for &Vec4

Source§

impl Neg for &Vec2

Source§

impl Neg for &Vec3

Source§

impl Neg for &DVec2

Source§

impl Neg for &DVec3

Source§

impl Neg for &DVec4

Source§

impl Neg for &I8Vec2

Source§

impl Neg for &I8Vec3

Source§

impl Neg for &I8Vec4

Source§

impl Neg for &I16Vec2

Source§

impl Neg for &I16Vec3

Source§

impl Neg for &I16Vec4

Source§

impl Neg for &IVec2

Source§

impl Neg for &IVec3

Source§

impl Neg for &IVec4

Source§

impl Neg for &I64Vec2

Source§

impl Neg for &I64Vec3

Source§

impl Neg for &I64Vec4

1.0.0 · Source§

impl Neg for f16

1.0.0 · Source§

impl Neg for f32

1.0.0 · Source§

impl Neg for f64

1.0.0 · Source§

impl Neg for f128

1.0.0 · Source§

impl Neg for i8

1.0.0 · Source§

impl Neg for i16

1.0.0 · Source§

impl Neg for i32

1.0.0 · Source§

impl Neg for i64

1.0.0 · Source§

impl Neg for i128

1.0.0 · Source§

impl Neg for isize

1.71.0 · Source§

impl Neg for NonZero<i8>

1.71.0 · Source§

impl Neg for NonZero<i16>

1.71.0 · Source§

impl Neg for NonZero<i32>

1.71.0 · Source§

impl Neg for NonZero<i64>

1.71.0 · Source§

impl Neg for NonZero<i128>

1.71.0 · Source§

impl Neg for NonZero<isize>

1.74.0 · Source§

impl Neg for Saturating<i8>

1.74.0 · Source§

impl Neg for Saturating<i16>

1.74.0 · Source§

impl Neg for Saturating<i32>

1.74.0 · Source§

impl Neg for Saturating<i64>

1.74.0 · Source§

impl Neg for Saturating<i128>

1.74.0 · Source§

impl Neg for Saturating<isize>

1.10.0 · Source§

impl Neg for Wrapping<i8>

1.10.0 · Source§

impl Neg for Wrapping<i16>

1.10.0 · Source§

impl Neg for Wrapping<i32>

1.10.0 · Source§

impl Neg for Wrapping<i64>

1.10.0 · Source§

impl Neg for Wrapping<i128>

1.10.0 · Source§

impl Neg for Wrapping<isize>

1.10.0 · Source§

impl Neg for Wrapping<u8>

1.10.0 · Source§

impl Neg for Wrapping<u16>

1.10.0 · Source§

impl Neg for Wrapping<u32>

1.10.0 · Source§

impl Neg for Wrapping<u64>

1.10.0 · Source§

impl Neg for Wrapping<u128>

1.10.0 · Source§

impl Neg for Wrapping<usize>

§

impl Neg for m128

§

type Output = m128

§

impl Neg for m128d

Source§

impl Neg for Float<f32>

Available on crate feature _float_f32 only.
Source§

impl Neg for Float<f64>

Available on crate feature _float_f64 only.
Source§

impl Neg for Int<i8>

Available on crate feature _int_i8 only.
Source§

impl Neg for Int<i16>

Available on crate feature _int_i16 only.
Source§

impl Neg for Int<i32>

Available on crate feature _int_i32 only.
Source§

impl Neg for Int<i64>

Available on crate feature _int_i64 only.
Source§

impl Neg for Int<i128>

Available on crate feature _int_i128 only.
Source§

impl Neg for Int<isize>

Available on crate feature _int_isize only.
§

impl Neg for SignedDuration

§

impl Neg for Span

§

type Output = Span

§

impl Neg for Offset

Negate this offset.

A positive offset becomes negative and vice versa. This is a no-op for the zero offset.

This never panics.

Source§

impl Neg for BigInt

Source§

type Output = <&'static BigInt as Neg>::Output

Source§

impl Neg for Number

Source§

type Output = <&'static Number as Neg>::Output

§

impl Neg for Frame

§

impl Neg for Mix

§

type Output = Mix

§

impl Neg for Panning

§

impl Neg for PlaybackRate

§

impl Neg for Semitones

§

impl Neg for f32_be

§

type Output = <f32 as Neg>::Output

§

impl Neg for f32_le

§

type Output = <f32 as Neg>::Output

§

impl Neg for f64_be

§

type Output = <f64 as Neg>::Output

§

impl Neg for f64_le

§

type Output = <f64 as Neg>::Output

§

impl Neg for i16_be

§

type Output = <i16 as Neg>::Output

§

impl Neg for i16_le

§

type Output = <i16 as Neg>::Output

§

impl Neg for i32_be

§

type Output = <i32 as Neg>::Output

§

impl Neg for i32_le

§

type Output = <i32 as Neg>::Output

§

impl Neg for i64_be

§

type Output = <i64 as Neg>::Output

§

impl Neg for i64_le

§

type Output = <i64 as Neg>::Output

§

impl Neg for i128_be

§

type Output = <i128 as Neg>::Output

§

impl Neg for i128_le

§

type Output = <i128 as Neg>::Output

§

impl Neg for f32_ube

§

type Output = <f32 as Neg>::Output

§

impl Neg for f32_ule

§

type Output = <f32 as Neg>::Output

§

impl Neg for f64_ube

§

type Output = <f64 as Neg>::Output

§

impl Neg for f64_ule

§

type Output = <f64 as Neg>::Output

§

impl Neg for i16_ube

§

type Output = <i16 as Neg>::Output

§

impl Neg for i16_ule

§

type Output = <i16 as Neg>::Output

§

impl Neg for i32_ube

§

type Output = <i32 as Neg>::Output

§

impl Neg for i32_ule

§

type Output = <i32 as Neg>::Output

§

impl Neg for i64_ube

§

type Output = <i64 as Neg>::Output

§

impl Neg for i64_ule

§

type Output = <i64 as Neg>::Output

§

impl Neg for i128_ube

§

type Output = <i128 as Neg>::Output

§

impl Neg for i128_ule

§

type Output = <i128 as Neg>::Output

§

impl Neg for I24

§

type Output = I24

§

impl Neg for I48

§

type Output = I48

Source§

impl Neg for JsValue

Source§

type Output = <&'static JsValue as Neg>::Output

§

impl Neg for f32x4

§

impl Neg for f32x8

§

impl Neg for f64x2

§

impl Neg for f64x4

§

impl Neg for i8x16

§

impl Neg for i8x32

§

impl Neg for i16x8

§

impl Neg for i16x16

§

impl Neg for i32x4

§

impl Neg for i32x8

§

impl Neg for i64x2

§

impl Neg for i64x4

§

impl Neg for u8x16

§

impl Neg for u16x8

§

impl Neg for u32x4

§

impl Neg for u32x8

§

impl Neg for u64x2

§

impl Neg for u64x4

Source§

impl Neg for Mat3

Source§

impl Neg for Mat2

Source§

impl Neg for Mat3A

Source§

impl Neg for Mat4

Source§

impl Neg for Quat

Source§

impl Neg for Vec3A

Source§

impl Neg for Vec4

Source§

impl Neg for Vec2

Source§

impl Neg for Vec3

Source§

impl Neg for DMat2

Source§

impl Neg for DMat3

Source§

impl Neg for DMat4

Source§

impl Neg for DQuat

Source§

impl Neg for DVec2

Source§

impl Neg for DVec3

Source§

impl Neg for DVec4

Source§

impl Neg for I8Vec2

Source§

impl Neg for I8Vec3

Source§

impl Neg for I8Vec4

Source§

impl Neg for I16Vec2

Source§

impl Neg for I16Vec3

Source§

impl Neg for I16Vec4

Source§

impl Neg for IVec2

Source§

impl Neg for IVec3

Source§

impl Neg for IVec4

Source§

impl Neg for I64Vec2

Source§

impl Neg for I64Vec3

Source§

impl Neg for I64Vec4

§

impl Neg for I11

§

type Output = I11

§

impl Neg for U11

§

type Output = U11

§

impl<'py> Neg for &Bound<'py, PyComplex>

§

type Output = Bound<'py, PyComplex>

§

impl<'py> Neg for Borrowed<'_, 'py, PyComplex>

§

type Output = Bound<'py, PyComplex>

§

impl<'py> Neg for Bound<'py, PyComplex>

§

type Output = Bound<'py, PyComplex>

§

impl<T> Neg for Value<T>
where T: Neg<Output = T>,

§

type Output = Value<T>

Source§

impl<const N: usize> Neg for Simd<f32, N>

Source§

impl<const N: usize> Neg for Simd<f64, N>

Source§

impl<const N: usize> Neg for Simd<i8, N>

Source§

impl<const N: usize> Neg for Simd<i16, N>

Source§

impl<const N: usize> Neg for Simd<i32, N>

Source§

impl<const N: usize> Neg for Simd<i64, N>

Source§

impl<const N: usize> Neg for Simd<isize, N>