Trait nom::lib::std::ops::Not 1.0.0[−][src]
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
Required methods
Implementations on Foreign Types
type Output = Saturating<i8>
type Output = Saturating<i32>
type Output = Saturating<u128>
type Output = Saturating<u64>
type Output = Saturating<i64>
type Output = Saturating<i16>
type Output = Saturating<isize>
type Output = Saturating<u16>
type Output = Saturating<i128>
type Output = Saturating<usize>
type Output = Saturating<u32>
type Output = Saturating<u8>
This implementation inverts all elements in the live buffer. You cannot rely
on the value of bits in the buffer that are outside the domain of
BitVec::as_mit_bitslice
.