-
Notifications
You must be signed in to change notification settings - Fork 784
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add optional support for conversion from Hashbrown types
This commit adds optional support for conversion from hashbrown's [1] HashMap [2] and HashSet [3] types. The HashMap and HashSet implementation in std::collections is a copy from HashBrown, but Hashbrown still provides some features over the std::collections version. Primarily this is rayon support and also using a default hasher which is faster (although not DOS resistent). The hashbrown versions provide a drop in replacement over std::collections to get these features. To take advantage of native type conversion in PyO3 this commit adds hashbrown as an optional dependency and when the feature is enabled the traits for going between python and hashbrown::HashMap and hashbrown::HashSet are available. This is handy for users of hashbrown which have to inline these conversions manually in functions that take dicts as args. [1] https://github.com/rust-lang/hashbrown [2] https://docs.rs/hashbrown/0.8.2/hashbrown/struct.HashMap.html [3] https://docs.rs/hashbrown/0.8.2/hashbrown/struct.HashSet.html
- Loading branch information
Showing
3 changed files
with
166 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters