Trait std::ops::Not
[−]
[src]
pub trait Not { type Output; fn not(self) -> Self::Output; }
The Not
trait is used to specify the functionality of unary !
.
Examples
A trivial implementation of Not
. When !Foo
happens, it ends up calling
not
, and therefore, main
prints Not-ing!
.
use std::ops::Not; struct Foo; impl Not for Foo { type Output = Foo; fn not(self) -> Foo { println!("Not-ing!"); self } } fn main() { !Foo; }
Associated Types
type Output
The resulting type after applying the !
operator
Required Methods
Implementors
impl Not for Wrapping<usize>
impl Not for Wrapping<u8>
impl Not for Wrapping<u16>
impl Not for Wrapping<u32>
impl Not for Wrapping<u64>
impl Not for Wrapping<isize>
impl Not for Wrapping<i8>
impl Not for Wrapping<i16>
impl Not for Wrapping<i32>
impl Not for Wrapping<i64>
impl Not for bool
impl<'a> Not for &'a bool
impl Not for usize
impl<'a> Not for &'a usize
impl Not for u8
impl<'a> Not for &'a u8
impl Not for u16
impl<'a> Not for &'a u16
impl Not for u32
impl<'a> Not for &'a u32
impl Not for u64
impl<'a> Not for &'a u64
impl Not for isize
impl<'a> Not for &'a isize
impl Not for i8
impl<'a> Not for &'a i8
impl Not for i16
impl<'a> Not for &'a i16
impl Not for i32
impl<'a> Not for &'a i32
impl Not for i64
impl<'a> Not for &'a i64