Trait Not

1.6.0 ยท Source
pub trait Not {
    type Output;

    // Required method
    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);

Required Associated Typesยง

1.0.0 ยท Source

type Output

The resulting type after applying the ! operator.

Required Methodsยง

1.0.0 ยท Source

fn not(self) -> Self::Output

Performs the unary ! operation.

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

Implementorsยง

1.0.0 ยท Sourceยง

impl Not for &bool

1.0.0 ยท Sourceยง

impl Not for &i8

1.0.0 ยท Sourceยง

impl Not for &i16

1.0.0 ยท Sourceยง

impl Not for &i32

1.0.0 ยท Sourceยง

impl Not for &i64

1.0.0 ยท Sourceยง

impl Not for &i128

1.0.0 ยท Sourceยง

impl Not for &isize

1.0.0 ยท Sourceยง

impl Not for &u8

1.0.0 ยท Sourceยง

impl Not for &u16

1.0.0 ยท Sourceยง

impl Not for &u32

1.0.0 ยท Sourceยง

impl Not for &u64

1.0.0 ยท Sourceยง

impl Not for &u128

1.0.0 ยท Sourceยง

impl Not for &usize

1.75.0 ยท Sourceยง

impl Not for &Ipv4Addr

1.75.0 ยท Sourceยง

impl Not for &Ipv6Addr

1.74.0 ยท Sourceยง

impl Not for &Saturating<i8>

1.74.0 ยท Sourceยง

impl Not for &Saturating<i16>

1.74.0 ยท Sourceยง

impl Not for &Saturating<i32>

1.74.0 ยท Sourceยง

impl Not for &Saturating<i64>

1.74.0 ยท Sourceยง

impl Not for &Saturating<i128>

1.74.0 ยท Sourceยง

impl Not for &Saturating<isize>

1.74.0 ยท Sourceยง

impl Not for &Saturating<u8>

1.74.0 ยท Sourceยง

impl Not for &Saturating<u16>

1.74.0 ยท Sourceยง

impl Not for &Saturating<u32>

1.74.0 ยท Sourceยง

impl Not for &Saturating<u64>

1.74.0 ยท Sourceยง

impl Not for &Saturating<u128>

1.74.0 ยท Sourceยง

impl Not for &Saturating<usize>

1.14.0 ยท Sourceยง

impl Not for &Wrapping<i8>

1.14.0 ยท Sourceยง

impl Not for &Wrapping<i16>

1.14.0 ยท Sourceยง

impl Not for &Wrapping<i32>

1.14.0 ยท Sourceยง

impl Not for &Wrapping<i64>

1.14.0 ยท Sourceยง

impl Not for &Wrapping<i128>

1.14.0 ยท Sourceยง

impl Not for &Wrapping<isize>

1.14.0 ยท Sourceยง

impl Not for &Wrapping<u8>

1.14.0 ยท Sourceยง

impl Not for &Wrapping<u16>

1.14.0 ยท Sourceยง

impl Not for &Wrapping<u32>

1.14.0 ยท Sourceยง

impl Not for &Wrapping<u64>

1.14.0 ยท Sourceยง

impl Not for &Wrapping<u128>

1.14.0 ยท Sourceยง

impl Not for &Wrapping<usize>

Sourceยง

impl Not for &BigInt

Sourceยง

impl Not for &Boolean

Sourceยง

impl Not for &Number

Sourceยง

impl Not for &JsValue

1.0.0 ยท Sourceยง

impl Not for bool

1.0.0 ยท Sourceยง

impl Not for i8

1.0.0 ยท Sourceยง

impl Not for i16

1.0.0 ยท Sourceยง

impl Not for i32

1.0.0 ยท Sourceยง

impl Not for i64

1.0.0 ยท Sourceยง

impl Not for i128

1.0.0 ยท Sourceยง

impl Not for isize

1.60.0 ยท Sourceยง

impl Not for !

1.0.0 ยท Sourceยง

impl Not for u8

1.0.0 ยท Sourceยง

impl Not for u16

1.0.0 ยท Sourceยง

impl Not for u32

1.0.0 ยท Sourceยง

impl Not for u64

1.0.0 ยท Sourceยง

impl Not for u128

1.0.0 ยท Sourceยง

impl Not for usize

Sourceยง

impl Not for ModuleURI

1.75.0 ยท Sourceยง

impl Not for Ipv4Addr

1.75.0 ยท Sourceยง

impl Not for Ipv6Addr

1.74.0 ยท Sourceยง

impl Not for Saturating<i8>

1.74.0 ยท Sourceยง

impl Not for Saturating<i16>

1.74.0 ยท Sourceยง

impl Not for Saturating<i32>

1.74.0 ยท Sourceยง

impl Not for Saturating<i64>

1.74.0 ยท Sourceยง

impl Not for Saturating<i128>

1.74.0 ยท Sourceยง

impl Not for Saturating<isize>

1.74.0 ยท Sourceยง

impl Not for Saturating<u8>

1.74.0 ยท Sourceยง

impl Not for Saturating<u16>

1.74.0 ยท Sourceยง

impl Not for Saturating<u32>

1.74.0 ยท Sourceยง

impl Not for Saturating<u64>

1.74.0 ยท Sourceยง

impl Not for Saturating<u128>

1.74.0 ยท Sourceยง

impl Not for Saturating<usize>

1.0.0 ยท Sourceยง

impl Not for Wrapping<i8>

1.0.0 ยท Sourceยง

impl Not for Wrapping<i16>

1.0.0 ยท Sourceยง

impl Not for Wrapping<i32>

1.0.0 ยท Sourceยง

impl Not for Wrapping<i64>

1.0.0 ยท Sourceยง

impl Not for Wrapping<i128>

1.0.0 ยท Sourceยง

impl Not for Wrapping<isize>

1.0.0 ยท Sourceยง

impl Not for Wrapping<u8>

1.0.0 ยท Sourceยง

impl Not for Wrapping<u16>

1.0.0 ยท Sourceยง

impl Not for Wrapping<u32>

1.0.0 ยท Sourceยง

impl Not for Wrapping<u64>

1.0.0 ยท Sourceยง

impl Not for Wrapping<u128>

1.0.0 ยท Sourceยง

impl Not for Wrapping<usize>

Sourceยง

impl Not for AttrCheckFlags

Sourceยง

impl Not for CheckoutNotificationType

Sourceยง

impl Not for CredentialType

Sourceยง

impl Not for DiffFlags

Sourceยง

impl Not for DiffStatsFormat

Sourceยง

impl Not for IndexAddOption

Sourceยง

impl Not for IndexEntryExtendedFlag

Sourceยง

impl Not for IndexEntryFlag

Sourceยง

impl Not for MergeAnalysis

Sourceยง

impl Not for MergePreference

Sourceยง

impl Not for OdbLookupFlags

Sourceยง

impl Not for PathspecFlags

Sourceยง

impl Not for ReferenceFormat

Sourceยง

impl Not for RemoteUpdateFlags

Sourceยง

impl Not for RepositoryInitMode

Sourceยง

impl Not for RepositoryOpenFlags

Sourceยง

impl Not for RevparseMode

Sourceยง

impl Not for Sort

Sourceยง

impl Not for StashApplyFlags

Sourceยง

impl Not for StashFlags

Sourceยง

impl Not for Status

Sourceยง

impl Not for SubmoduleStatus

Sourceยง

impl Not for BigInt

Sourceยง

type Output = <&'static BigInt as Not>::Output

Sourceยง

impl Not for Boolean

Sourceยง

type Output = <&'static Boolean as Not>::Output

Sourceยง

impl Not for Number

Sourceยง

type Output = <&'static Number as Not>::Output

Sourceยง

impl Not for CipherCtxFlags

Sourceยง

impl Not for CMSOptions

Sourceยง

impl Not for OcspFlag

Sourceยง

impl Not for Pkcs7Flags

Sourceยง

impl Not for ExtensionContext

Sourceยง

impl Not for ShutdownState

Sourceยง

impl Not for SslMode

Sourceยง

impl Not for SslOptions

Sourceยง

impl Not for SslSessionCacheMode

Sourceยง

impl Not for SslVerifyMode

Sourceยง

impl Not for X509CheckFlags

Sourceยง

impl Not for X509VerifyFlags

Sourceยง

impl Not for Choice

Sourceยง

impl Not for B0

Not of 0 (!0 = 1)

Sourceยง

impl Not for B1

Not of 1 (!1 = 0)

Sourceยง

impl Not for JsValue

Sourceยง

type Output = <&'static JsValue as Not>::Output

ยง

impl Not for Access

ยง

type Output = Access

ยง

impl Not for Access

ยง

type Output = Access

ยง

impl Not for AtFlags

ยง

type Output = AtFlags

ยง

impl Not for AtFlags

ยง

type Output = AtFlags

ยง

impl Not for ChannelType

ยง

type Output = ChannelType

ยง

impl Not for ColorFallbackKind

ยง

type Output = ColorFallbackKind

ยง

impl Not for ColorScheme

ยง

type Output = ColorScheme

ยง

impl Not for CreateFlags

ยง

type Output = CreateFlags

ยง

impl Not for CreateFlags

ยง

type Output = CreateFlags

ยง

impl Not for CreateFlags

ยง

type Output = CreateFlags

ยง

impl Not for DupFlags

ยง

type Output = DupFlags

ยง

impl Not for DupFlags

ยง

type Output = DupFlags

ยง

impl Not for ElementSelectorFlags

ยง

type Output = ElementSelectorFlags

ยง

impl Not for EventFlags

ยง

type Output = EventFlags

ยง

impl Not for EventfdFlags

ยง

type Output = EventfdFlags

ยง

impl Not for Expression

ยง

type Output = Expression

ยง

impl Not for FallocateFlags

ยง

type Output = FallocateFlags

ยง

impl Not for FallocateFlags

ยง

type Output = FallocateFlags

ยง

impl Not for FdFlags

ยง

type Output = FdFlags

ยง

impl Not for FdFlags

ยง

type Output = FdFlags

ยง

impl Not for Features

ยง

type Output = Features

ยง

impl Not for FloatingPointEmulationControl

ยง

type Output = FloatingPointEmulationControl

ยง

impl Not for FloatingPointExceptionMode

ยง

type Output = FloatingPointExceptionMode

ยง

impl Not for GridAutoFlow

ยง

type Output = GridAutoFlow

ยง

impl Not for IFlags

ยง

type Output = IFlags

ยง

impl Not for IFlags

ยง

type Output = IFlags

ยง

impl Not for MemfdFlags

ยง

type Output = MemfdFlags

ยง

impl Not for MemfdFlags

ยง

type Output = MemfdFlags

ยง

impl Not for Mode

ยง

type Output = Mode

ยง

impl Not for Mode

ยง

type Output = Mode

ยง

impl Not for MountFlags

ยง

type Output = MountFlags

ยง

impl Not for MountPropagationFlags

ยง

type Output = MountPropagationFlags

ยง

impl Not for OFlags

ยง

type Output = OFlags

ยง

impl Not for OFlags

ยง

type Output = OFlags

ยง

impl Not for ParserFlags

ยง

type Output = ParserFlags

ยง

impl Not for PidfdFlags

ยง

type Output = PidfdFlags

ยง

impl Not for PidfdGetfdFlags

ยง

type Output = PidfdGetfdFlags

ยง

impl Not for PipeFlags

ยง

type Output = PipeFlags

ยง

impl Not for PollFlags

ยง

type Output = PollFlags

ยง

impl Not for ReadFlags

ยง

type Output = ReadFlags

ยง

impl Not for ReadFlags

ยง

type Output = ReadFlags

ยง

impl Not for ReadWriteFlags

ยง

type Output = ReadWriteFlags

ยง

impl Not for ReadWriteFlags

ยง

type Output = ReadWriteFlags

ยง

impl Not for RecvFlags

ยง

type Output = RecvFlags

ยง

impl Not for RenameFlags

ยง

type Output = RenameFlags

ยง

impl Not for RenameFlags

ยง

type Output = RenameFlags

ยง

impl Not for ResolveFlags

ยง

type Output = ResolveFlags

ยง

impl Not for ResolveFlags

ยง

type Output = ResolveFlags

ยง

impl Not for ReturnFlags

ยง

type Output = ReturnFlags

ยง

impl Not for SealFlags

ยง

type Output = SealFlags

ยง

impl Not for SealFlags

ยง

type Output = SealFlags

ยง

impl Not for SendFlags

ยง

type Output = SendFlags

ยง

impl Not for SocketAddrXdpFlags

ยง

type Output = SocketAddrXdpFlags

ยง

impl Not for SocketFlags

ยง

type Output = SocketFlags

ยง

impl Not for SpeculationFeatureControl

ยง

type Output = SpeculationFeatureControl

ยง

impl Not for SpeculationFeatureState

ยง

type Output = SpeculationFeatureState

ยง

impl Not for SpliceFlags

ยง

type Output = SpliceFlags

ยง

impl Not for StatVfsMountFlags

ยง

type Output = StatVfsMountFlags

ยง

impl Not for StatVfsMountFlags

ยง

type Output = StatVfsMountFlags

ยง

impl Not for StatxAttributes

ยง

type Output = StatxAttributes

ยง

impl Not for StatxFlags

ยง

type Output = StatxFlags

ยง

impl Not for StatxFlags

ยง

type Output = StatxFlags

ยง

impl Not for TextDecorationLine

ยง

type Output = TextDecorationLine

ยง

impl Not for TextTransformOther

ยง

type Output = TextTransformOther

ยง

impl Not for TimerfdFlags

ยง

type Output = TimerfdFlags

ยง

impl Not for TimerfdTimerFlags

ยง

type Output = TimerfdTimerFlags

ยง

impl Not for UnalignedAccessControl

ยง

type Output = UnalignedAccessControl

ยง

impl Not for UnmountFlags

ยง

type Output = UnmountFlags

ยง

impl Not for VendorPrefix

ยง

type Output = VendorPrefix

ยง

impl Not for WaitIdOptions

ยง

type Output = WaitIdOptions

ยง

impl Not for WaitOptions

ยง

type Output = WaitOptions

ยง

impl Not for WatchFlags

ยง

type Output = WatchFlags

ยง

impl Not for WatchFlags

ยง

type Output = WatchFlags

ยง

impl Not for XattrFlags

ยง

type Output = XattrFlags

ยง

impl Not for XattrFlags

ยง

type Output = XattrFlags

ยง

impl Not for XdpDescOptions

ยง

type Output = XdpDescOptions

ยง

impl Not for XdpOptionsFlags

ยง

type Output = XdpOptionsFlags

ยง

impl Not for XdpRingFlags

ยง

type Output = XdpRingFlags

ยง

impl Not for XdpUmemRegFlags

ยง

type Output = XdpUmemRegFlags

ยง

impl<O> Not for I16<O>

ยง

type Output = I16<O>

ยง

impl<O> Not for I32<O>

ยง

type Output = I32<O>

ยง

impl<O> Not for I64<O>

ยง

type Output = I64<O>

ยง

impl<O> Not for I128<O>

ยง

type Output = I128<O>

ยง

impl<O> Not for Isize<O>

ยง

type Output = Isize<O>

ยง

impl<O> Not for U16<O>

ยง

type Output = U16<O>

ยง

impl<O> Not for U32<O>

ยง

type Output = U32<O>

ยง

impl<O> Not for U64<O>

ยง

type Output = U64<O>

ยง

impl<O> Not for U128<O>

ยง

type Output = U128<O>

ยง

impl<O> Not for Usize<O>

ยง

type Output = Usize<O>

Sourceยง

impl<T, const N: usize> Not for Mask<T, N>

Sourceยง

impl<const N: usize> Not for Simd<i8, N>

Sourceยง

impl<const N: usize> Not for Simd<i16, N>

Sourceยง

impl<const N: usize> Not for Simd<i32, N>

Sourceยง

impl<const N: usize> Not for Simd<i64, N>

Sourceยง

impl<const N: usize> Not for Simd<isize, N>

Sourceยง

impl<const N: usize> Not for Simd<u8, N>

Sourceยง

impl<const N: usize> Not for Simd<u16, N>

Sourceยง

impl<const N: usize> Not for Simd<u32, N>

Sourceยง

impl<const N: usize> Not for Simd<u64, N>

Sourceยง

impl<const N: usize> Not for Simd<usize, N>