-
Notifications
You must be signed in to change notification settings - Fork 495
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
We need an FAQ #1647
Comments
I think an FAQ is a good idea. I will note that we used to have an FAQ and we may wish to bring that back in some form. I will also note that it is a common and well received practice to have markdown "book-style" tutorials for crates. The |
Yep, it's a fine line but I would like to avoid getting into guide/book/doc format until we're confident things are relatively settled and I can afford to commit resources to do that well. The old FAQ was just a little too early and so much has changed, but |
+1 from me for having some of these kinds of questions answered. I just ran into that two days ago and was bugging @rylev for answers 😄 In general, perhaps a table that maps common idioms from C++/COM to Rust/windows-rs/COM would be helpful? I can try to write down what I've learned over the last week if that would be helpful. |
I spent a bunch of time in Rust Discord communities and some recent ones I've helped folks with:
|
Ok, since I got a thumbs up, this is the table I would loved to have had on Monday 🙂
Since my program seems to be working, I believe this is technically correct but perhaps not idiomatic. |
Hey @wesleywiser that's a great example of something I plan to simplify so that it is just inherently less confusing. 😄 |
Links to docs.microsoft.com for functions, structs, unions, enums and constants would be really useful |
That's a good suggestion and something I've been wanting to add to the generated docs, but not something that would be part of an FAQ. 😉 Feel free top to open a new issue for it. |
Here's another one I predict will get asked:
|
The other question is what format the FAQ should take. FAQs tend to be long markdown docs and while that works well enough, it has a few challenges. It ends up as part of the "source code" for the repository, is more work to maintain and comment on as PRs are required, a TOC needs to be maintained, and so forth. GitHub wiki and discussions are other potential solutions but have their own drawbacks. I was thinking of the FAQ being a set of GitHub issues with an "FAQ" label. The issue's title would form the “question” and the original issue body would provide the “answer”. Folks can then comment on the entry and suggest improvements and the author (or other maintainers) can polish and just generally keep it up to date. We could have an FAQ markdown doc that simply provides links to the various FAQ issues or simply an FAQ link on the repo's readme that points to a query for all the FAQ issues like: https://github.com/microsoft/windows-rs/issues?q=label%3Afaq Obviously, the repo maintainers (regular contributors) would exercise oversight over the process to ensure that the FAQ issues are relevant and high quality. We would need to decide which issues get the "FAQ" label, but anyone could put one forward as a candidate for the FAQ. The main difficulty is having people accidentally - or mischievously 😉 - add the FAQ label to other issues. |
This is a very (most) important question really, which needs a good explanation! |
Q: Why is the type of |
I've moved some of the outstanding questions (without answers) from the FAQ here to avoid confusion:
We can move them back as we have the answers written up. |
@kennykerr Maybe this is just because I've been following this project since the
However, since the focus of this repo has switched more toward pre-generated bindings for the Windows API, I have begun to wonder if those questions are not even primary concerns. Perhaps in addition to the FAQ, it might be nice if there was a roadmap for this repo that gave at least some information on what features |
A question I've had multiple times: When do I need to manually free memory, and how should I do it? This is is a complex area, but if it's possible to provide some high-level guidance that would be useful. ExamplesWhen I started using COM it wasn't clear to me whether I needed to manually call Later I started writing code like this:
I spent a while looking through the |
Another question I've had: How can I call methods with out parameters? Out parameters are common in Win32 APIs but relatively rare in Rust, and IMO it's not obvious how to use them. I eventually ended up settling on a pattern like: let mut foo = MaybeUninit::<SomeType>::uninit();
SomeWindowsFunction(foo.as_mut_ptr())?;
let foo = foo.assume_init(); |
@rgwood Or let mut foo = Foo::default();
Function(foo.as_mut_ptr())?; |
Going to close this issue as we now have an FAQ and while its still quite sparse, it covers the most common questions I hear. If there are other pressing questions you think should be added, feel free to open a new issue. |
Eventually I'd like to get our doc writers involved, but I'm not quite ready to unleash their talents. For the time being, I think it would be handy just to have an informal FAQ to deal with common questions. Naturally, anything in the FAQ is also a candidate for simplifying this project in some way to avoid needing an FAQ in the first place. Still, there will always be common issues that newcomers will run into. Here's a start, based on some common questions I've received:
windows
andwindows-sys
cratesWhat's on your wish list for an FAQ?
The text was updated successfully, but these errors were encountered: