1.0.0[][src]Trait af_lib::prelude::Not

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

type Output[src]

The resulting type after applying the ! operator.

Loading content...

Required methods

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

Performs the unary ! operation.

Examples

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

Implementations on Foreign Types

impl Not for Wrapping<u32>[src]

type Output = Wrapping<u32>

impl Not for i8[src]

type Output = i8

impl Not for u8[src]

type Output = u8

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

type Output = <isize as Not>::Output

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

type Output = <i64 as Not>::Output

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

type Output = <u128 as Not>::Output

impl Not for Wrapping<i64>[src]

type Output = Wrapping<i64>

impl Not for Wrapping<u8>[src]

type Output = Wrapping<u8>

impl Not for Wrapping<u128>[src]

type Output = Wrapping<u128>

impl Not for Wrapping<i128>[src]

type Output = Wrapping<i128>

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

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

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

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

impl Not for bool[src]

type Output = bool

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

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

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

type Output = <bool as Not>::Output

impl Not for i16[src]

type Output = i16

impl Not for Wrapping<usize>[src]

type Output = Wrapping<usize>

impl Not for Wrapping<i16>[src]

type Output = Wrapping<i16>

impl Not for u16[src]

type Output = u16

impl Not for i128[src]

type Output = i128

impl Not for i64[src]

type Output = i64

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

type Output = <u32 as Not>::Output

impl Not for u32[src]

type Output = u32

impl Not for usize[src]

type Output = usize

impl Not for Wrapping<i8>[src]

type Output = Wrapping<i8>

impl Not for Wrapping<isize>[src]

type Output = Wrapping<isize>

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

type Output = <usize as Not>::Output

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

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

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

type Output = <i128 as Not>::Output

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

type Output = <u8 as Not>::Output

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

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

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

type Output = <u64 as Not>::Output

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

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

impl Not for u64[src]

type Output = u64

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

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

impl Not for Wrapping<u16>[src]

type Output = Wrapping<u16>

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

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

impl Not for isize[src]

type Output = isize

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

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

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

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

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

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

impl Not for Wrapping<i32>[src]

type Output = Wrapping<i32>

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

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

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

type Output = <u16 as Not>::Output

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

type Output = <i8 as Not>::Output

impl Not for i32[src]

type Output = i32

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

type Output = <i16 as Not>::Output

impl Not for Wrapping<u64>[src]

type Output = Wrapping<u64>

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

type Output = <i32 as Not>::Output

impl Not for u128[src]

type Output = u128

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

type Output = BigInt

impl Not for BigInt[src]

type Output = BigInt

impl Not for B1

Not of 1 (!1 = 0)

type Output = B0

impl Not for B0

Not of 0 (!0 = 1)

type Output = B1

impl Not for Choice[src]

type Output = Choice

impl<Size> Not for Bitmap<Size> where
    Size: Bits, 

type Output = Bitmap<Size>

impl Not for ExtensionContext[src]

type Output = ExtensionContext

pub fn not(self) -> ExtensionContext[src]

Returns the complement of this set of flags.

impl Not for Pkcs7Flags[src]

type Output = Pkcs7Flags

pub fn not(self) -> Pkcs7Flags[src]

Returns the complement of this set of flags.

impl Not for CMSOptions[src]

type Output = CMSOptions

pub fn not(self) -> CMSOptions[src]

Returns the complement of this set of flags.

impl Not for SslVerifyMode[src]

type Output = SslVerifyMode

pub fn not(self) -> SslVerifyMode[src]

Returns the complement of this set of flags.

impl Not for ShutdownState[src]

type Output = ShutdownState

pub fn not(self) -> ShutdownState[src]

Returns the complement of this set of flags.

impl Not for SslOptions[src]

type Output = SslOptions

pub fn not(self) -> SslOptions[src]

Returns the complement of this set of flags.

impl Not for X509VerifyFlags[src]

type Output = X509VerifyFlags

pub fn not(self) -> X509VerifyFlags[src]

Returns the complement of this set of flags.

impl Not for OcspFlag[src]

type Output = OcspFlag

pub fn not(self) -> OcspFlag[src]

Returns the complement of this set of flags.

impl Not for SslSessionCacheMode[src]

type Output = SslSessionCacheMode

pub fn not(self) -> SslSessionCacheMode[src]

Returns the complement of this set of flags.

impl Not for X509CheckFlags[src]

type Output = X509CheckFlags

pub fn not(self) -> X509CheckFlags[src]

Returns the complement of this set of flags.

impl Not for SslMode[src]

type Output = SslMode

pub fn not(self) -> SslMode[src]

Returns the complement of this set of flags.

Loading content...

Implementors

Loading content...