-
-
Notifications
You must be signed in to change notification settings - Fork 405
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
[[HostDefined]]
Improvements
#3460
[[HostDefined]]
Improvements
#3460
Conversation
d5f18f8
to
fe26dbd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks really great! Just have a comment about the lint and some suggestions.
fe26dbd
to
ab6a9f1
Compare
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #3460 +/- ##
==========================================
- Coverage 44.65% 44.62% -0.04%
==========================================
Files 487 487
Lines 50503 50541 +38
==========================================
Hits 22554 22554
- Misses 27949 27987 +38
☔ View full report in Codecov by Sentry. |
ab6a9f1
to
79279ad
Compare
Currently `[[HostDefined]]` doesn't permit you to mutably borrow two objects from the `[[HostDefined]]` field since the `FxHashMap` is wrapped under a `GcRefCell`. This commit implements a `get_mut_many` (from `hashbrown`'s `HashMap`) method to permit accessing several `NativeObject`s using a `NativeTuple`. Additionally, this commit takes the opportunity to provide automatic downcasting on the `insert` and `remove` methods for `[[HostDefined]]`.
79279ad
to
022ee6a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent work!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice addition! Looks good to me! :)
* Refactor the `[[HostDefined]]` implementation. Currently `[[HostDefined]]` doesn't permit you to mutably borrow two objects from the `[[HostDefined]]` field since the `FxHashMap` is wrapped under a `GcRefCell`. This commit implements a `get_mut_many` (from `hashbrown`'s `HashMap`) method to permit accessing several `NativeObject`s using a `NativeTuple`. Additionally, this commit takes the opportunity to provide automatic downcasting on the `insert` and `remove` methods for `[[HostDefined]]`. * Update `[[HostDefined]]` example.
* Refactor the `[[HostDefined]]` implementation. Currently `[[HostDefined]]` doesn't permit you to mutably borrow two objects from the `[[HostDefined]]` field since the `FxHashMap` is wrapped under a `GcRefCell`. This commit implements a `get_mut_many` (from `hashbrown`'s `HashMap`) method to permit accessing several `NativeObject`s using a `NativeTuple`. Additionally, this commit takes the opportunity to provide automatic downcasting on the `insert` and `remove` methods for `[[HostDefined]]`. * Update `[[HostDefined]]` example.
* Refactor the `[[HostDefined]]` implementation. Currently `[[HostDefined]]` doesn't permit you to mutably borrow two objects from the `[[HostDefined]]` field since the `FxHashMap` is wrapped under a `GcRefCell`. This commit implements a `get_mut_many` (from `hashbrown`'s `HashMap`) method to permit accessing several `NativeObject`s using a `NativeTuple`. Additionally, this commit takes the opportunity to provide automatic downcasting on the `insert` and `remove` methods for `[[HostDefined]]`. * Update `[[HostDefined]]` example.
Context
Related PRs: #3370
Currently
HostDefined
doesn't permit you to mutably borrow two objects from the[[HostDefined]]
field since theFxHashMap
is wrapped under aGcRefCell
.Description
This PR implements a
get_mut_many
(fromhashbrown
'sHashMap
) method to permit accessing severalNativeObject
s using aNativeTuple
.Additionally, this commit takes the opportunity to provide automatic downcasting on the
insert
andremove
methods for[[HostDefined]]
.