Crates.io | by_address |
lib.rs | by_address |
version | 1.2.1 |
source | src |
created_at | 2017-10-23 19:34:15.627632 |
updated_at | 2024-03-27 19:10:33.275879 |
description | Wrapper for comparing and hashing pointers by address |
homepage | |
repository | https://github.com/mbrubeck/by_address |
max_upload_size | |
id | 36711 |
size | 25,619 |
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:
This crate does not depend on libstd, so it can be used in no_std
projects.
ByThinAddress
as repr(transparent)
.from_ref
constructor.ByThinAddress
type.Display
trait.Debug
that includess the pointer address.From<T>
for ByAddress<T>
Licensed under the Apache License, Version 2.0 or the MIT license, at your option. See the license files in this directory for details.