I'm not sure, but isn't that exactly what your by_address
crate (or in a different but similar way my crate refid
) does, but as a generic? See also: Working with identity (comparing equality of references/pointers).
Edit: I mean implementing all three traits PartialEq
, Eq
, and Hash
on a newtype to define equality "by address".