core::ops::Not - Rust
Description: API documentation for the Rust `Not` trait in crate `core`.
Keywords: rust, rustlang, rust-lang, Not

# 1.0.0[−][src]Trait core::ops::Not

    #[lang = "not"]
    pub trait Not {
        type Output;
    #[must_use]
        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) -> Self::Output {
            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.

Loading content...

## Required methods

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

Performs the unary `!` operation.

Loading content...

## Implementors

### `impl Not for Wrapping<i8>`[src]

#### `type Output = Wrapping<i8>`

#### `fn not(self) -> Wrapping<i8>`[src]

### `impl Not for Wrapping<i16>`[src]

#### `type Output = Wrapping<i16>`

#### `fn not(self) -> Wrapping<i16>`[src]

### `impl Not for Wrapping<i32>`[src]

#### `type Output = Wrapping<i32>`

#### `fn not(self) -> Wrapping<i32>`[src]

### `impl Not for Wrapping<i64>`[src]

#### `type Output = Wrapping<i64>`

#### `fn not(self) -> Wrapping<i64>`[src]

### `impl Not for Wrapping<i128>`[src]

#### `type Output = Wrapping<i128>`

#### `fn not(self) -> Wrapping<i128>`[src]

### `impl Not for Wrapping<isize>`[src]

#### `type Output = Wrapping<isize>`

#### `fn not(self) -> Wrapping<isize>`[src]

### `impl Not for Wrapping<u8>`[src]

#### `type Output = Wrapping<u8>`

#### `fn not(self) -> Wrapping<u8>`[src]

### `impl Not for Wrapping<u16>`[src]

#### `type Output = Wrapping<u16>`

#### `fn not(self) -> Wrapping<u16>`[src]

### `impl Not for Wrapping<u32>`[src]

#### `type Output = Wrapping<u32>`

#### `fn not(self) -> Wrapping<u32>`[src]

### `impl Not for Wrapping<u64>`[src]

#### `type Output = Wrapping<u64>`

#### `fn not(self) -> Wrapping<u64>`[src]

### `impl Not for Wrapping<u128>`[src]

#### `type Output = Wrapping<u128>`

#### `fn not(self) -> Wrapping<u128>`[src]

### `impl Not for Wrapping<usize>`[src]

#### `type Output = Wrapping<usize>`

#### `fn not(self) -> Wrapping<usize>`[src]

### `impl Not for bool`[src]

#### `type Output = bool`

#### `fn not(self) -> bool`[src]

### `impl Not for i8`[src]

#### `type Output = i8`

#### `fn not(self) -> i8`[src]

### `impl Not for i16`[src]

#### `type Output = i16`

#### `fn not(self) -> i16`[src]

### `impl Not for i32`[src]

#### `type Output = i32`

#### `fn not(self) -> i32`[src]

### `impl Not for i64`[src]

#### `type Output = i64`

#### `fn not(self) -> i64`[src]

### `impl Not for i128`[src]

#### `type Output = i128`

#### `fn not(self) -> i128`[src]

### `impl Not for isize`[src]

#### `type Output = isize`

#### `fn not(self) -> isize`[src]

### `impl Not for u8`[src]

#### `type Output = u8`

#### `fn not(self) -> u8`[src]

### `impl Not for u16`[src]

#### `type Output = u16`

#### `fn not(self) -> u16`[src]

### `impl Not for u32`[src]

#### `type Output = u32`

#### `fn not(self) -> u32`[src]

### `impl Not for u64`[src]

#### `type Output = u64`

#### `fn not(self) -> u64`[src]

### `impl Not for u128`[src]

#### `type Output = u128`

#### `fn not(self) -> u128`[src]

### `impl Not for usize`[src]

#### `type Output = usize`

#### `fn not(self) -> usize`[src]

### `impl<'_> Not for &'_ Wrapping<i8>`[src]

#### `type Output = <Wrapping<i8> as Not>::Output`

#### `fn not(self) -> <Wrapping<i8> as Not>::Output`[src]

### `impl<'_> Not for &'_ Wrapping<i16>`[src]

#### `type Output = <Wrapping<i16> as Not>::Output`

#### `fn not(self) -> <Wrapping<i16> as Not>::Output`[src]

### `impl<'_> Not for &'_ Wrapping<i32>`[src]

#### `type Output = <Wrapping<i32> as Not>::Output`

#### `fn not(self) -> <Wrapping<i32> as Not>::Output`[src]

### `impl<'_> Not for &'_ Wrapping<i64>`[src]

#### `type Output = <Wrapping<i64> as Not>::Output`

#### `fn not(self) -> <Wrapping<i64> as Not>::Output`[src]

### `impl<'_> Not for &'_ Wrapping<i128>`[src]

#### `type Output = <Wrapping<i128> as Not>::Output`

#### `fn not(self) -> <Wrapping<i128> as Not>::Output`[src]

### `impl<'_> Not for &'_ Wrapping<isize>`[src]

#### `type Output = <Wrapping<isize> as Not>::Output`

#### `fn not(self) -> <Wrapping<isize> as Not>::Output`[src]

### `impl<'_> Not for &'_ Wrapping<u8>`[src]

#### `type Output = <Wrapping<u8> as Not>::Output`

#### `fn not(self) -> <Wrapping<u8> as Not>::Output`[src]

### `impl<'_> Not for &'_ Wrapping<u16>`[src]

#### `type Output = <Wrapping<u16> as Not>::Output`

#### `fn not(self) -> <Wrapping<u16> as Not>::Output`[src]

### `impl<'_> Not for &'_ Wrapping<u32>`[src]

#### `type Output = <Wrapping<u32> as Not>::Output`

#### `fn not(self) -> <Wrapping<u32> as Not>::Output`[src]

### `impl<'_> Not for &'_ Wrapping<u64>`[src]

#### `type Output = <Wrapping<u64> as Not>::Output`

#### `fn not(self) -> <Wrapping<u64> as Not>::Output`[src]

### `impl<'_> Not for &'_ Wrapping<u128>`[src]

#### `type Output = <Wrapping<u128> as Not>::Output`

#### `fn not(self) -> <Wrapping<u128> as Not>::Output`[src]

### `impl<'_> Not for &'_ Wrapping<usize>`[src]

#### `type Output = <Wrapping<usize> as Not>::Output`

#### `fn not(self) -> <Wrapping<usize> as Not>::Output`[src]

### `impl<'_> Not for &'_ bool`[src]

#### `type Output = <bool as Not>::Output`

#### `fn not(self) -> <bool as Not>::Output`[src]

### `impl<'_> Not for &'_ i8`[src]

#### `type Output = <i8 as Not>::Output`

#### `fn not(self) -> <i8 as Not>::Output`[src]

### `impl<'_> Not for &'_ i16`[src]

#### `type Output = <i16 as Not>::Output`

#### `fn not(self) -> <i16 as Not>::Output`[src]

### `impl<'_> Not for &'_ i32`[src]

#### `type Output = <i32 as Not>::Output`

#### `fn not(self) -> <i32 as Not>::Output`[src]

### `impl<'_> Not for &'_ i64`[src]

#### `type Output = <i64 as Not>::Output`

#### `fn not(self) -> <i64 as Not>::Output`[src]

### `impl<'_> Not for &'_ i128`[src]

#### `type Output = <i128 as Not>::Output`

#### `fn not(self) -> <i128 as Not>::Output`[src]

### `impl<'_> Not for &'_ isize`[src]

#### `type Output = <isize as Not>::Output`

#### `fn not(self) -> <isize as Not>::Output`[src]

### `impl<'_> Not for &'_ u8`[src]

#### `type Output = <u8 as Not>::Output`

#### `fn not(self) -> <u8 as Not>::Output`[src]

### `impl<'_> Not for &'_ u16`[src]

#### `type Output = <u16 as Not>::Output`

#### `fn not(self) -> <u16 as Not>::Output`[src]

### `impl<'_> Not for &'_ u32`[src]

#### `type Output = <u32 as Not>::Output`

#### `fn not(self) -> <u32 as Not>::Output`[src]

### `impl<'_> Not for &'_ u64`[src]

#### `type Output = <u64 as Not>::Output`

#### `fn not(self) -> <u64 as Not>::Output`[src]

### `impl<'_> Not for &'_ u128`[src]

#### `type Output = <u128 as Not>::Output`

#### `fn not(self) -> <u128 as Not>::Output`[src]

### `impl<'_> Not for &'_ usize`[src]

#### `type Output = <usize as Not>::Output`

#### `fn not(self) -> <usize as Not>::Output`[src]

Loading content...