Introducing the dedicated windows-collections
crate
#3483
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The windows crate mostly includes bindings generated by the windows-bindgen crate, but there are a handful of hand-written stock implementations for things like collections, numerics, and async support that I'm planning to move into dedicated crates to make it easier to depend on these implementations without pulling in a dependency on the large
windows
crate.This update introduces the
windows-collections
crate that contains the definitions for the core collection interfaces as well as stock implementations that you can use to avoid having to implement the collection interfaces yourself. The stock collections were first introduced with #2346, #2350, and #2353. These are now all part of the newwindows-collections
crate. In future I may also provide additional stock implementations, but this covers the vast majority of usage.This builds on the reference support introduced with the
windows-bindgen
overhaul introduced in #3359. A minor tweak was required to make it a little more flexible as this is the first major application of the reference redirection capabilities.Using the new
windows-collections
crate is easy. Start by adding the following to your Cargo.toml file (once the crate is published):Use the Windows collection types as needed: