Rust wrapper type that implements hashing and comparison based on address rather than value.
ByAddress
can be used to wrap any pointer type (i.e. any type that implements the Deref
trait). This includes references, raw pointers, smart pointers like Rc<T>
and Box<T>
, and specialized pointer-like types such as Vec<T>
and String
.
The wrapped pointer implements the following traits based on the address of its contents, rather than their value:
- Hash
- Eq, PartialEq
- Ord, PartialOrd
This crate does not depend on libstd, so it can be used in no_std
projects.
- Mark
ByThinAddress
asrepr(transparent)
.
- Add
from_ref
constructor.
- Improved documentations.
- Update to Rust 2021.
- New
ByThinAddress
type. - Implement the
Display
trait. - Custom implementation of
Debug
that includess the pointer address.
- Improve hashing of fat pointers
- Implement
From<T>
forByAddress<T>
- More documentation fixes
- More documentation fixes
- Improved documentation
- Initial release
Licensed under the Apache License, Version 2.0 or the MIT license, at your option. See the license files in this directory for details.