compare_by_address_derive

Crates.iocompare_by_address_derive
lib.rscompare_by_address_derive
version0.1.1
sourcesrc
created_at2022-03-20 23:28:01.140398
updated_at2022-03-26 14:57:25.115346
descriptionDerive macro for comparing and hashing structs/unions/enums by address
homepage
repositoryhttps://github.com/ewyler/compare_by_address_derive
max_upload_size
id553766
size4,552
Eric Wyler (ewyler)

documentation

https://docs.rs/compare_by_address

README

Defines PartialEq, Eq, and Hash to compare the given struct/union/enum by address to other instances. This allows you to easily work with these items in hashing contexts (HashSets, HashMaps, etc.) whereby equality is defined by instance irrespective of content.

Example usage

use compare_by_address_derive::CompareByAddress;

#[derive(CompareByAddress)]
struct SomeStruct {
  // ...
}
Commit count: 6

cargo fmt