Crates.io | multi-eq |
lib.rs | multi-eq |
version | 0.1.1 |
source | src |
created_at | 2020-03-10 22:27:22.58675 |
updated_at | 2020-03-10 23:47:16.593312 |
description | Macros for creating custom equality trait derives |
homepage | |
repository | https://github.com/Wright-Language-Developers/multi-eq-rs/ |
max_upload_size | |
id | 217396 |
size | 16,731 |
multi_eq
multi_eq
is a macro library for creating custom equality trait derives.
/// Custom comparison trait `CustomEq` with a method `custom_eq`
multi_eq_make_trait!(CustomEq, custom_eq);
#[derive(CustomEq)]
struct MyStruct {
// Use `PartialEq` to compare this field
#[custom_eq(cmp = "eq")]
a: u32,
// Ignore value of this field when checking equality
#[custom_eq(ignore)]
b: bool,
}
For more information, see the documentation.