-
Notifications
You must be signed in to change notification settings - Fork 12.4k
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
API Docs: process #29370
Comments
|
This API really could use a better documentation. To list all failure cases of several functions would be great :) |
…klabnik Add process types documentation Part of rust-lang#29370. r? @steveklabnik
…klabnik Add process types documentation Part of rust-lang#29370. r? @steveklabnik
…klabnik Add process types documentation Part of rust-lang#29370. r? @steveklabnik
…klabnik Add process types documentation Part of rust-lang#29370. r? @steveklabnik
…klabnik Add process types documentation Part of rust-lang#29370. r? @steveklabnik
…klabnik Add process types documentation Part of rust-lang#29370. r? @steveklabnik
…klabnik Add process types documentation Part of rust-lang#29370. r? @steveklabnik
|
I am happy to mentor anyone who wants to tackle this issue. |
|
I'd like to help tackle this one and learn more about the Rust process module :) |
|
I've had to muck around with this module a lot for my own libraries and things. I'll be glad to tackle a few of these to help document them for others. |
|
@julienXX @mgattozzi wonderful! Let me know if you need help in any way. |
|
Hi @steveklabnik I would like to try to tackle this issue but I need some mentor help (first time). Is adding this example for If it's not considered useless, I could add it by creating a PR (with this code in a Side note: I don't know right how to show off its destuctor behavior |
|
Hey @rap2hpoutre ! Sure thing 😄 So, this example is good as a basic one, though I might add use std::process;
fn main() {
println!("aborting");
process::abort();
// execution never gets here
}That is, two things:
That said, after this basic example, another one would be good as well, showing this:
So, the key is that destruction never get run. This is in contrast with the default For something like For something that matters more, we need something with a
The first example might be more straightforward and clear, but the latter example might be more realistic. It might even be worth it to include both, actually.... what do you think? A PR for one, two, or three of these examples would be great. We've already talked about the first one above, but if you're interested in these more complex ones, we can go into detail about what they should look like 😄 They also don't all have to be in the same PR.
That'd be wonderful, and yes, all PRs go to master 😄 |
|
Excellent! |
|
Done! But before I open a PR, can I make sure I'm not misunderstanding anything? Commits for the two changes are here: Also, I mention Cargo.toml in part of the description of panic=abort. Is that OK, or do we avoid mentioning cargo concepts in the std lib documentation? |
|
Don't worry about opening up PRs, it's actually easiest to review as a PR. WIP PRs are totally fine!
We don't, but not due to any specific policy exactly, it's just never been directly relevant. |
|
(Oh, and these look good to me!) |
|
Great! I'll submit a PR just now and in future go straight ahead. Thanks for taking a look though. |
Update docs for process::abort Remove a typo and explain the relationship to `panic!`. Part of #29370 r? @steveklabnik
|
Think I'm going to take a look at the Stdio links/examples. |
|
@steveklabnik the two abort check boxes should be ticked off now that #44905 was merged |
Add links and examples for std::process::Stdio As per rust-lang#29370
|
I'd like to help improve the module docs. |
|
@Technius that'd be great! Let me know if you need any help! |
…labnik Link std::process::Output to Command and Child As per rust-lang#29370
…labnik Link std::process::Output to Command and Child As per rust-lang#29370
Document defaults for stdin, stdout, and stderr methods of Command For rust-lang#29370
|
The The All that's left (I think) is module level documentation, and an explanation of how stdio works in different Windows subsystems. |
Improve std::process module docs Addresses part of rust-lang#29370 I've changed the first `cat` example to a "Hello World" example involving echo, and I've also added another example showing how to pipe output. I'm still working on the module-level description. For now, I'd like feedback on the examples. r? @steveklabnik
Improve std::process module docs Addresses part of #29370 I've changed the first `cat` example to a "Hello World" example involving echo, and I've also added another example showing how to pipe output. I'm still working on the module-level description. For now, I'd like feedback on the examples. r? @steveklabnik
|
I'm giving this issue a close. Thank you to everyone who's pitched in on these docs over the last few years. If there's still improvements to do here, please open a new issue, one per thing. Thanks! |
Part of #29329
http://doc.rust-lang.org/std/process/
Here's what needs to be done to close out this issue:
abortneeds an example, preferably showing off its destuctor behavior. (some elaboration here, and a first PR here)abortshould also talk about its relationship withpanic!, specifically, unwinding vs aborting panics.aborthas a bug:The [abort] function terminates the process, the[]s need to be dropped.ChildtheNoteshouldn't be one, and should come before the examples.ChildStderrshould have its second sentence as not a summary, needs some newlines.ChildStdinhas the same issue.ChildStdouthas the same issue.Commandis good but many of its methods could use more elaboration in their docs. See below for some details.ExitStatusshould link tostatus, and itscodemethod needs an example.Outputshould link tooutput.Stdioshould link tostdioand needs expanded explanations and examples.exitneeds some examples to show its behavior. An example of how people use this inmainwould be fantastic too.With regards to
Command, @frewsxcv brought up in #40983 thatstdin,stdout, andstderrshould specify what the default behavior is if they aren't explicitly called.And @retep998 mentions
The text was updated successfully, but these errors were encountered: