Windows-rs: Whenever Kenny Kerr goes silent for a bit...

Created on 21 Jan 2021  路  2Comments  路  Source: microsoft/windows-rs

... things are happening.

This is awesome news! Though I have a few questions: Where does windows-rs fit in in terms of the classic Windows API? Specific questions I have:

  • Is it a replacement for the raw winapi crate only?
  • Does it go beyond that and provide facilities like the WIL?
  • Or is it even higher level, like a sane MFC/ATL/WTL?

And, of course, like every one else, where does win32.winmd come from?

question

Most helpful comment

Thanks Tim,

Is it a replacement for the raw winapi crate only?

Yes, I would expect the windows crate to gradually replace the winapi crate. There may be gaps in API coverage, but we're working hard to get everything covered and work out any kinks.

Does it go beyond that and provide facilities like the WIL?

There are basic helpers for things like string and error handling, but I would expect the Rust community to continue developing specific and focused crates for various tasks. Think of the windows crate as a foundation building block for more specific or targeted crates that provide richer helpers like those provided by WIL.

Or is it even higher level, like a sane MFC/ATL/WTL?

The windows crate makes the Windows API available to Rust developers. Some APIs, like those based on WinRT, will have rich Rust bindings that don't need any wrappers to make them useful and safe in Rust. Other APIs, like those based on C-style functions often called Win32 APIs, will likely benefit from being wrapped in specific crates to provide a more idiomatic experience in Rust.

And, of course, like every one else, where does win32.winmd come from?

The metadata for Win32 APIs comes from this project: https://github.com/microsoft/win32metadata

All 2 comments

Thanks Tim,

Is it a replacement for the raw winapi crate only?

Yes, I would expect the windows crate to gradually replace the winapi crate. There may be gaps in API coverage, but we're working hard to get everything covered and work out any kinks.

Does it go beyond that and provide facilities like the WIL?

There are basic helpers for things like string and error handling, but I would expect the Rust community to continue developing specific and focused crates for various tasks. Think of the windows crate as a foundation building block for more specific or targeted crates that provide richer helpers like those provided by WIL.

Or is it even higher level, like a sane MFC/ATL/WTL?

The windows crate makes the Windows API available to Rust developers. Some APIs, like those based on WinRT, will have rich Rust bindings that don't need any wrappers to make them useful and safe in Rust. Other APIs, like those based on C-style functions often called Win32 APIs, will likely benefit from being wrapped in specific crates to provide a more idiomatic experience in Rust.

And, of course, like every one else, where does win32.winmd come from?

The metadata for Win32 APIs comes from this project: https://github.com/microsoft/win32metadata

Closing as the questions are answered. We're tracking that these questions should be answered in some sort of FAQ in issue #460.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bdbai picture bdbai  路  3Comments

joverwey picture joverwey  路  3Comments

rylev picture rylev  路  3Comments

rylev picture rylev  路  4Comments

rylev picture rylev  路  4Comments