Trait nom::lib::std::ops::Not 1.0.0[−][src]
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
Loading content...Required methods
#[must_use]pub fn not(self) -> Self::Output
[src]
#[must_use]
pub fn not(self) -> Self::OutputPerforms the unary !
operation.
Examples
assert_eq!(!true, false); assert_eq!(!false, true); assert_eq!(!1u8, 254); assert_eq!(!0u8, 255);
Implementations on Foreign Types
impl<'_> Not for &'_ Wrapping<isize>
[src]
impl<'_> Not for &'_ Wrapping<isize>
[src]impl<'_> Not for &'_ Wrapping<i16>
[src]
impl<'_> Not for &'_ Wrapping<i16>
[src]impl<'_> Not for &'_ Wrapping<i128>
[src]
impl<'_> Not for &'_ Wrapping<i128>
[src]impl<'_> Not for &'_ u128
[src]
impl<'_> Not for &'_ u128
[src]impl<'_> Not for &'_ Wrapping<i64>
[src]
impl<'_> Not for &'_ Wrapping<i64>
[src]impl<'_> Not for &'_ isize
[src]
impl<'_> Not for &'_ isize
[src]impl<'_> Not for &'_ Wrapping<i8>
[src]
impl<'_> Not for &'_ Wrapping<i8>
[src]impl<'_> Not for &'_ i16
[src]
impl<'_> Not for &'_ i16
[src]impl<'_> Not for &'_ i8
[src]
impl<'_> Not for &'_ i8
[src]impl<'_> Not for &'_ Wrapping<u32>
[src]
impl<'_> Not for &'_ Wrapping<u32>
[src]impl<'_> Not for &'_ u32
[src]
impl<'_> Not for &'_ u32
[src]impl<'_> Not for &'_ Wrapping<usize>
[src]
impl<'_> Not for &'_ Wrapping<usize>
[src]impl Not for Wrapping<isize>
[src]
impl Not for Wrapping<isize>
[src]impl<'_> Not for &'_ u16
[src]
impl<'_> Not for &'_ u16
[src]impl Not for Wrapping<usize>
[src]
impl Not for Wrapping<usize>
[src]impl<'_> Not for &'_ i32
[src]
impl<'_> Not for &'_ i32
[src]impl<'_> Not for &'_ Wrapping<u16>
[src]
impl<'_> Not for &'_ Wrapping<u16>
[src]impl<'_> Not for &'_ usize
[src]
impl<'_> Not for &'_ usize
[src]impl<'_> Not for &'_ Wrapping<i32>
[src]
impl<'_> Not for &'_ Wrapping<i32>
[src]impl<'_> Not for &'_ i128
[src]
impl<'_> Not for &'_ i128
[src]impl<'_> Not for &'_ u8
[src]
impl<'_> Not for &'_ u8
[src]impl<'_> Not for &'_ i64
[src]
impl<'_> Not for &'_ i64
[src]impl<'_> Not for &'_ Wrapping<u128>
[src]
impl<'_> Not for &'_ Wrapping<u128>
[src]impl<'_> Not for &'_ bool
[src]
impl<'_> Not for &'_ bool
[src]impl<'_> Not for &'_ Wrapping<u64>
[src]
impl<'_> Not for &'_ Wrapping<u64>
[src]impl<'_> Not for &'_ Wrapping<u8>
[src]
impl<'_> Not for &'_ Wrapping<u8>
[src]impl<'_> Not for &'_ u64
[src]
impl<'_> Not for &'_ u64
[src]