-
Notifications
You must be signed in to change notification settings - Fork 225
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
Refactor Resources #617
Refactor Resources #617
Conversation
ae70d92
to
5744d8f
Compare
Another option, instead of a If we like the /edit: This is how it is implemented now: |
Note to self: #84 is also a very interesting approach (completely doing away with the necessary pre-registration for resource types!), I'm just not quite sure how to incorporate monitors into it. |
dd69859
to
f7aee7e
Compare
- Move storage of "Type->NIF Resource Type Handle" to a OnceLock map to allow implementing resource types without resorting to dynamic trait implementations - Add direct access methods to get an immutable reference to the wrapped objects - Add corresponding converters - Add monitor resource implementation - Require explicit trait implementation (not when using the existing macro for compatibility) - Allow implementing a "destructor" function that runs just before `Drop` but has access to the caller environment
derive
macro (this one is removed again)This allows us to eventually deprecate the existing
resource!
macro and enables a path that fixes #606.