Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Weak references? #3

Open
Rua opened this issue Feb 10, 2019 · 1 comment
Open

Support for Weak references? #3

Rua opened this issue Feb 10, 2019 · 1 comment

Comments

@Rua
Copy link

Rua commented Feb 10, 2019

At the moment, you can't create a ByAddress wrapper for a Weak reference, because these don't implement the Deref trait, only strong references do. But it would certainly be useful to be able to hash and compare these by the address of the pointed-to value. Is there a way that this can be done?

@mbrubeck
Copy link
Owner

This could be done using the Weak::into_raw method, though I think it would need to be a separate type from ByAddress.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants