mbrubeck/by_address

Rust wrapper type that implements hashing and comparison by pointer address

Rust

37

31 commits

updated Mar 27, 2024

See the code

README

by_address

Rust wrapper type that implements hashing and comparison based on address rather than value.

Overview

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

no_std

This crate does not depend on libstd, so it can be used in no_std projects.

Release notes

Version 1.2.1

  • Mark ByThinAddress as repr(transparent).

Version 1.2.0

  • Add from_ref constructor.

Version 1.1.2

  • Improved documentations.

Version 1.1.1

  • Update to Rust 2021.

Version 1.1.0

  • New ByThinAddress type.
  • Implement the Display trait.
  • Custom implementation of Debug that includess the pointer address.

Version 1.0.4

  • Improve hashing of fat pointers

Version 1.0.3

  • Implement From<T> for ByAddress<T>
  • More documentation fixes

Version 1.0.2

  • More documentation fixes

Version 1.0.1

  • Improved documentation

Version 1.0.0

  • Initial release

License

Licensed under the Apache License, Version 2.0 or the MIT license, at your option. See the license files in this directory for details.

mbrubeck/by_address

Rust wrapper type that implements hashing and comparison by pointer address

Rust

37

31 commits

updated Mar 27, 2024

See the code

README

by_address

Rust wrapper type that implements hashing and comparison based on address rather than value.

Overview

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

no_std

This crate does not depend on libstd, so it can be used in no_std projects.

Release notes

Version 1.2.1

  • Mark ByThinAddress as repr(transparent).

Version 1.2.0

  • Add from_ref constructor.

Version 1.1.2

  • Improved documentations.

Version 1.1.1

  • Update to Rust 2021.

Version 1.1.0

  • New ByThinAddress type.
  • Implement the Display trait.
  • Custom implementation of Debug that includess the pointer address.

Version 1.0.4

  • Improve hashing of fat pointers

Version 1.0.3

  • Implement From<T> for ByAddress<T>
  • More documentation fixes

Version 1.0.2

  • More documentation fixes

Version 1.0.1

  • Improved documentation

Version 1.0.0

  • Initial release

License

Licensed under the Apache License, Version 2.0 or the MIT license, at your option. See the license files in this directory for details.

Project health

Overall

2.0/10

Maintained

0/10

Code review

0/10
OpenSSF Scorecard

crates.io

Latest release

2.1.0 · Oct 28, 2022

Releases this year

0
Deprecated

Significant stargazers

IWANABETHATGUY

665 followers · starred Apr 2024

Sam Estep

138 followers · starred Sep 2023

Zixuan Chen

632 followers · starred Apr 2024

Benoît Cortier

130 followers · starred Oct 2023