Trait nom::lib::std::ops::Not1.0.0[][src]

#[lang = "not"]
pub trait Not { type Output; fn not(self) -> Self::Output; }

The unary logical negation operator !.

Examples

An implementation of Not for Answer, which enables the use of ! to invert its value.

use std::ops::Not;

#[derive(Debug, PartialEq)]
enum Answer {
    Yes,
    No,
}

impl Not for Answer {
    type Output = Answer;

    fn not(self) -> Answer {
        match self {
            Answer::Yes => Answer::No,
            Answer::No => Answer::Yes
        }
    }
}

assert_eq!(!Answer::Yes, Answer::No);
assert_eq!(!Answer::No, Answer::Yes);

Associated Types

The resulting type after applying the ! operator.

Required Methods

Performs the unary ! operation.

Implementations on Foreign Types

impl Not for u8x2
[src]

impl Not for u32x4
[src]

impl<'a> Not for &'a Wrapping<u16>
[src]

impl<'a> Not for &'a Wrapping<u128>
[src]

impl Not for Wrapping<i32>
[src]

impl<'a> Not for &'a u128
[src]

impl Not for Wrapping<u16>
[src]

impl Not for i64x4
[src]

impl Not for m16x8
[src]

impl Not for Wrapping<u128>
[src]

impl<'a> Not for &'a Wrapping<i128>
[src]

impl Not for m1x8
[src]

impl Not for m8x32
[src]

impl Not for u16x4
[src]

impl<'a> Not for &'a i16
[src]

impl Not for m32x2
[src]

impl<'a> Not for &'a Wrapping<i32>
[src]

impl Not for u16x16
[src]

impl Not for u16
[src]

impl Not for m16x2
[src]

impl Not for u128
[src]

impl Not for i32
[src]

impl Not for m1x32
[src]

impl Not for Wrapping<u64>
[src]

impl Not for m16x16
[src]

impl Not for u8x64
[src]

impl Not for bool
[src]

impl Not for Wrapping<u8>
[src]

impl Not for i32x4
[src]

impl<'a> Not for &'a i64
[src]

impl Not for u32x2
[src]

impl<'a> Not for &'a Wrapping<i16>
[src]

impl<'a> Not for &'a bool
[src]

impl Not for u64
[src]

impl<'a> Not for &'a Wrapping<u64>
[src]

impl Not for Wrapping<i8>
[src]

impl<'a> Not for &'a u64
[src]

impl<'a> Not for &'a u16
[src]

impl Not for m1x64
[src]

impl<'a> Not for &'a u8
[src]

impl Not for m1x16
[src]

impl Not for Wrapping<usize>
[src]

impl Not for i8x8
[src]

impl Not for i64
[src]

impl Not for i16x8
[src]

impl Not for m16x4
[src]

impl Not for u16x32
[src]

impl<'a> Not for &'a isize
[src]

impl Not for i8x16
[src]

impl Not for isize
[src]

impl Not for m64x2
[src]

impl Not for i8x2
[src]

impl Not for u8
[src]

impl Not for u8x16
[src]

impl Not for Wrapping<u32>
[src]

impl Not for m32x8
[src]

impl Not for i16x16
[src]

impl<'a> Not for &'a Wrapping<usize>
[src]

impl Not for m32x4
[src]

impl Not for u64x4
[src]

impl Not for usize
[src]

impl Not for Wrapping<isize>
[src]

impl<'a> Not for &'a i32
[src]

impl Not for Wrapping<i128>
[src]

impl<'a> Not for &'a usize
[src]

impl Not for i16x32
[src]

impl<'a> Not for &'a i8
[src]

impl Not for i32x8
[src]

impl Not for i8x32
[src]

impl<'a> Not for &'a Wrapping<i8>
[src]

impl<'a> Not for &'a i128
[src]

impl Not for u8x8
[src]

impl Not for i8x4
[src]

impl<'a> Not for &'a Wrapping<u8>
[src]

impl Not for i16x2
[src]

impl Not for u32x8
[src]

impl Not for i32x2
[src]

impl<'a> Not for &'a u32
[src]

impl Not for i64x8
[src]

impl Not for Wrapping<i16>
[src]

impl<'a> Not for &'a Wrapping<isize>
[src]

impl Not for m64x4
[src]

impl Not for m8x2
[src]

impl Not for u32x16
[src]

impl Not for u16x8
[src]

impl Not for i16x4
[src]

impl Not for u64x8
[src]

impl Not for i64x2
[src]

impl Not for m8x4
[src]

impl Not for u8x4
[src]

impl Not for i8x64
[src]

impl Not for m8x8
[src]

impl<'a> Not for &'a Wrapping<u32>
[src]

impl Not for u8x32
[src]

impl Not for m8x16
[src]

impl Not for Wrapping<i64>
[src]

impl<'a> Not for &'a Wrapping<i64>
[src]

impl Not for i16
[src]

impl Not for u32
[src]

impl Not for u64x2
[src]

impl Not for i8
[src]

impl Not for i32x16
[src]

impl Not for i128
[src]

impl Not for u16x2
[src]

Implementors