# Trait core::ops::Not 1.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);Run

## Associated Types

### `type Output`

The resulting type after applying the `!` operator.

## Required Methods

### `fn not(self) -> Self::Output`

Performs the unary `!` operation.

## Implementors

- `impl Not for Wrapping<usize> type Output = Wrapping<usize>;` | [src]

- `impl<'a> Not for &'a Wrapping<usize> type Output = <Wrapping<usize> as Not>::Output;` | [src]

- `impl Not for Wrapping<u8> type Output = Wrapping<u8>;` | [src]

- `impl<'a> Not for &'a Wrapping<u8> type Output = <Wrapping<u8> as Not>::Output;` | [src]

- `impl Not for Wrapping<u16> type Output = Wrapping<u16>;` | [src]

- `impl<'a> Not for &'a Wrapping<u16> type Output = <Wrapping<u16> as Not>::Output;` | [src]

- `impl Not for Wrapping<u32> type Output = Wrapping<u32>;` | [src]

- `impl<'a> Not for &'a Wrapping<u32> type Output = <Wrapping<u32> as Not>::Output;` | [src]

- `impl Not for Wrapping<u64> type Output = Wrapping<u64>;` | [src]

- `impl<'a> Not for &'a Wrapping<u64> type Output = <Wrapping<u64> as Not>::Output;` | [src]

- `impl Not for Wrapping<u128> type Output = Wrapping<u128>;` | [src]

- `impl<'a> Not for &'a Wrapping<u128> type Output = <Wrapping<u128> as Not>::Output;` | [src]

- `impl Not for Wrapping<isize> type Output = Wrapping<isize>;` | [src]

- `impl<'a> Not for &'a Wrapping<isize> type Output = <Wrapping<isize> as Not>::Output;` | [src]

- `impl Not for Wrapping<i8> type Output = Wrapping<i8>;` | [src]

- `impl<'a> Not for &'a Wrapping<i8> type Output = <Wrapping<i8> as Not>::Output;` | [src]

- `impl Not for Wrapping<i16> type Output = Wrapping<i16>;` | [src]

- `impl<'a> Not for &'a Wrapping<i16> type Output = <Wrapping<i16> as Not>::Output;` | [src]

- `impl Not for Wrapping<i32> type Output = Wrapping<i32>;` | [src]

- `impl<'a> Not for &'a Wrapping<i32> type Output = <Wrapping<i32> as Not>::Output;` | [src]

- `impl Not for Wrapping<i64> type Output = Wrapping<i64>;` | [src]

- `impl<'a> Not for &'a Wrapping<i64> type Output = <Wrapping<i64> as Not>::Output;` | [src]

- `impl Not for Wrapping<i128> type Output = Wrapping<i128>;` | [src]

- `impl<'a> Not for &'a Wrapping<i128> type Output = <Wrapping<i128> as Not>::Output;` | [src]

- `impl Not for bool type Output = bool;` | [src]

- `impl<'a> Not for &'a bool type Output = <bool as Not>::Output;` | [src]

- `impl Not for usize type Output = usize;` | [src]

- `impl<'a> Not for &'a usize type Output = <usize as Not>::Output;` | [src]

- `impl Not for u8 type Output = u8;` | [src]

- `impl<'a> Not for &'a u8 type Output = <u8 as Not>::Output;` | [src]

- `impl Not for u16 type Output = u16;` | [src]

- `impl<'a> Not for &'a u16 type Output = <u16 as Not>::Output;` | [src]

- `impl Not for u32 type Output = u32;` | [src]

- `impl<'a> Not for &'a u32 type Output = <u32 as Not>::Output;` | [src]

- `impl Not for u64 type Output = u64;` | [src]

- `impl<'a> Not for &'a u64 type Output = <u64 as Not>::Output;` | [src]

- `impl Not for u128 type Output = u128;` | [src]

- `impl<'a> Not for &'a u128 type Output = <u128 as Not>::Output;` | [src]

- `impl Not for isize type Output = isize;` | [src]

- `impl<'a> Not for &'a isize type Output = <isize as Not>::Output;` | [src]

- `impl Not for i8 type Output = i8;` | [src]

- `impl<'a> Not for &'a i8 type Output = <i8 as Not>::Output;` | [src]

- `impl Not for i16 type Output = i16;` | [src]

- `impl<'a> Not for &'a i16 type Output = <i16 as Not>::Output;` | [src]

- `impl Not for i32 type Output = i32;` | [src]

- `impl<'a> Not for &'a i32 type Output = <i32 as Not>::Output;` | [src]

- `impl Not for i64 type Output = i64;` | [src]

- `impl<'a> Not for &'a i64 type Output = <i64 as Not>::Output;` | [src]

- `impl Not for i128 type Output = i128;` | [src]

- `impl<'a> Not for &'a i128 type Output = <i128 as Not>::Output;` | [src]

- `impl Not for i8x16 type Output = Self;` | [src]

- `impl Not for u8x16 type Output = Self;` | [src]

- `impl Not for m8x16 type Output = Self;` | [src]

- `impl Not for i16x8 type Output = Self;` | [src]

- `impl Not for u16x8 type Output = Self;` | [src]

- `impl Not for m16x8 type Output = Self;` | [src]

- `impl Not for i32x4 type Output = Self;` | [src]

- `impl Not for u32x4 type Output = Self;` | [src]

- `impl Not for m32x4 type Output = Self;` | [src]

- `impl Not for i64x2 type Output = Self;` | [src]

- `impl Not for u64x2 type Output = Self;` | [src]

- `impl Not for m64x2 type Output = Self;` | [src]

- `impl Not for i8x2 type Output = Self;` | [src]

- `impl Not for u8x2 type Output = Self;` | [src]

- `impl Not for m8x2 type Output = Self;` | [src]

- `impl Not for i8x32 type Output = Self;` | [src]

- `impl Not for u8x32 type Output = Self;` | [src]

- `impl Not for m8x32 type Output = Self;` | [src]

- `impl Not for i16x16 type Output = Self;` | [src]

- `impl Not for u16x16 type Output = Self;` | [src]

- `impl Not for m16x16 type Output = Self;` | [src]

- `impl Not for i32x8 type Output = Self;` | [src]

- `impl Not for u32x8 type Output = Self;` | [src]

- `impl Not for m32x8 type Output = Self;` | [src]

- `impl Not for i64x4 type Output = Self;` | [src]

- `impl Not for u64x4 type Output = Self;` | [src]

- `impl Not for m64x4 type Output = Self;` | [src]

- `impl Not for i16x2 type Output = Self;` | [src]

- `impl Not for u16x2 type Output = Self;` | [src]

- `impl Not for m16x2 type Output = Self;` | [src]

- `impl Not for i8x4 type Output = Self;` | [src]

- `impl Not for u8x4 type Output = Self;` | [src]

- `impl Not for m8x4 type Output = Self;` | [src]

- `impl Not for i8x64 type Output = Self;` | [src]

- `impl Not for u8x64 type Output = Self;` | [src]

- `impl Not for m1x64 type Output = Self;` | [src]

- `impl Not for i16x32 type Output = Self;` | [src]

- `impl Not for u16x32 type Output = Self;` | [src]

- `impl Not for m1x32 type Output = Self;` | [src]

- `impl Not for i32x16 type Output = Self;` | [src]

- `impl Not for u32x16 type Output = Self;` | [src]

- `impl Not for m1x16 type Output = Self;` | [src]

- `impl Not for i64x8 type Output = Self;` | [src]

- `impl Not for u64x8 type Output = Self;` | [src]

- `impl Not for m1x8 type Output = Self;` | [src]

- `impl Not for i8x8 type Output = Self;` | [src]

- `impl Not for u8x8 type Output = Self;` | [src]

- `impl Not for m8x8 type Output = Self;` | [src]

- `impl Not for i16x4 type Output = Self;` | [src]

- `impl Not for u16x4 type Output = Self;` | [src]

- `impl Not for m16x4 type Output = Self;` | [src]

- `impl Not for i32x2 type Output = Self;` | [src]

- `impl Not for u32x2 type Output = Self;` | [src]

- `impl Not for m32x2 type Output = Self;` | [src]

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)

Search multiple things at once by splitting your query with comma (e.g. `str,u8` or `String,struct:Vec,test`)