[−][src]Attribute Macro opimps::impl_uni_op
#[impl_uni_op]
Implements the unary operators for the specified type.
use core::ops::Not; struct A { val: bool } #[opimps::impl_uni_op(Not)] fn not(self: A) -> A { return A { val: !self.val }; } let a = A { val: false }; let b = !a; assert_eq!(true, b.val);