Trait otter_api_tests::imports::failure::_core::ops::Not1.0.0[][src]

pub trait Not {
    type Output;
    #[must_use]
    fn not(self) -> Self::Output;
}
Expand description

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 = Self;

    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);

Associated Types

The resulting type after applying the ! operator.

Required methods

Performs the unary ! operation.

Examples

assert_eq!(!true, false);
assert_eq!(!false, true);
assert_eq!(!1u8, 254);
assert_eq!(!0u8, 255);

Implementations on Foreign Types

Returns the complement of this set of flags.

Returns the complement of this set of flags.

Returns the complement of this set of flags.

Returns the complement of this set of flags.

Returns the complement of this set of flags.

Returns the complement of this set of flags.

Returns the complement of this set of flags.

Returns the complement of this set of flags.

Returns the complement of this set of flags.

Returns the complement of this set of flags.

Returns the complement of this set of flags.

Returns the complement of this set of flags.

Returns the complement of this set of flags.

Returns the complement of this set of flags.

Returns the complement of this set of flags.

Returns the complement of this set of flags.

Implementors

Returns the complement of this set of flags.

Not of 0 (!0 = 1)

Not of 1 (!1 = 0)

Returns the complement of this set of flags.

Returns the complement of this set of flags.

Returns the complement of this set of flags.

Returns the complement of this set of flags.

Returns the complement of this set of flags.

Returns the complement of this set of flags.

Returns the complement of this set of flags.

Returns the complement of this set of flags.

Returns the complement of this set of flags.

Returns the complement of this set of flags.

Returns the complement of this set of flags.

Returns the complement of this set of flags.

Returns the complement of this set of flags.

Returns the complement of this set of flags.

Returns the complement of this set of flags.

Returns the complement of this set of flags.

Returns the complement of this set of flags.

Returns the complement of this set of flags.

Returns the complement of this set of flags.

Returns the complement of this set of flags.

Returns the complement of this set of flags.

Returns the complement of this set of flags.

Returns the complement of this set of flags.

Returns the complement of this set of flags.

Returns the complement of this set of flags.

Returns the complement of this set of flags.

Returns the complement of this set of flags.

Returns the complement of this set of flags.

Returns the complement of this set of flags.

Returns the complement of this set of flags.

Returns the complement of this set of flags.

Returns the complement of this set of flags.

Returns the complement of this set of flags.

Returns the complement of this set of flags.

Returns the complement of this set of flags.

Returns the complement of this set of flags.

Returns the complement of this set of flags.

Returns the complement of this set of flags.

Returns the complement of this set of flags.

Returns the complement of this set of flags.

Returns the complement of this set of flags.

Returns the complement of this set of flags.

Returns the complement of this set of flags.