Attribute Macro solders_macros::richcmp_full
source · #[richcmp_full]
Expand description
Add a __richcmp__
to the impl using the RichcmpFull
trait.
Example
use solders_macros::richcmp_full;
#[derive(Debug)]
struct Foo(u8);
#[richcmp_full]
impl Foo {
pub fn richcmp(&self, other: &Self, op: CompareOp) -> bool { // Fake implementation in place of `RichcmpFull`.
true
}
}
let foo = Foo(3);
assert_eq!(true, foo.__richcmp__(&foo, CompareOp::Eq));