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
impl<const LANES: usize> Not for Simd<u8, LANES> where
u8: SimdElement,
LaneCount<LANES>: SupportedLaneCount,
impl<const LANES: usize> Not for Simd<u8, LANES> where
u8: SimdElement,
LaneCount<LANES>: SupportedLaneCount,
impl<const LANES: usize> Not for Simd<u16, LANES> where
u16: SimdElement,
LaneCount<LANES>: SupportedLaneCount,
impl<const LANES: usize> Not for Simd<u16, LANES> where
u16: SimdElement,
LaneCount<LANES>: SupportedLaneCount,
impl<const LANES: usize> Not for Simd<u64, LANES> where
u64: SimdElement,
LaneCount<LANES>: SupportedLaneCount,
impl<const LANES: usize> Not for Simd<u64, LANES> where
u64: SimdElement,
LaneCount<LANES>: SupportedLaneCount,
impl<const LANES: usize> Not for Simd<i64, LANES> where
i64: SimdElement,
LaneCount<LANES>: SupportedLaneCount,
impl<const LANES: usize> Not for Simd<i64, LANES> where
i64: SimdElement,
LaneCount<LANES>: SupportedLaneCount,
impl<const LANES: usize> Not for Simd<isize, LANES> where
isize: SimdElement,
LaneCount<LANES>: SupportedLaneCount,
impl<const LANES: usize> Not for Simd<isize, LANES> where
isize: SimdElement,
LaneCount<LANES>: SupportedLaneCount,
impl<const LANES: usize> Not for Simd<usize, LANES> where
usize: SimdElement,
LaneCount<LANES>: SupportedLaneCount,
impl<const LANES: usize> Not for Simd<usize, LANES> where
usize: SimdElement,
LaneCount<LANES>: SupportedLaneCount,
impl<T, const LANES: usize> Not for Mask<T, LANES> where
T: MaskElement,
LaneCount<LANES>: SupportedLaneCount,
impl<T, const LANES: usize> Not for Mask<T, LANES> where
T: MaskElement,
LaneCount<LANES>: SupportedLaneCount,
impl<const LANES: usize> Not for Simd<i8, LANES> where
i8: SimdElement,
LaneCount<LANES>: SupportedLaneCount,
impl<const LANES: usize> Not for Simd<i8, LANES> where
i8: SimdElement,
LaneCount<LANES>: SupportedLaneCount,
impl<const LANES: usize> Not for Simd<i32, LANES> where
i32: SimdElement,
LaneCount<LANES>: SupportedLaneCount,
impl<const LANES: usize> Not for Simd<i32, LANES> where
i32: SimdElement,
LaneCount<LANES>: SupportedLaneCount,
impl<const LANES: usize> Not for Simd<i16, LANES> where
i16: SimdElement,
LaneCount<LANES>: SupportedLaneCount,
impl<const LANES: usize> Not for Simd<i16, LANES> where
i16: SimdElement,
LaneCount<LANES>: SupportedLaneCount,
impl<const LANES: usize> Not for Simd<u32, LANES> where
u32: SimdElement,
LaneCount<LANES>: SupportedLaneCount,
impl<const LANES: usize> Not for Simd<u32, LANES> where
u32: SimdElement,
LaneCount<LANES>: SupportedLaneCount,
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
.