-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Add tokio::process::Command::as_std_mut()
method.
#6523
Comments
@ipetkov Thoughts on this? |
Hi @Jisu-Woniu we already have a For example: let mut cmd = std::process::Command::new("echo");
cmd.args(["hello", "world"]).groups(groups);
tokio::process::Command::from(cmd)
.kill_on_drop(true)
.spawn()
.expect("failed to start")
.await
.expect("failed to run"); |
But I have a function taking a tokio So I was wondering: can I convert between tokio |
Biggest concern is that we prevent ourselves from making other changes in the future due to backwards compatibility, but since we already have the |
My initial thought was that exposing Even if that wasn't the case, you could do pretty much anything you wanted to a (Another upside would be that callers can use the latest methods on |
I think it's okay to add this. |
Is your feature request related to a problem? Please describe.
Sometimes I want to access a mutable reference of
std::process::Command
out of the tokio counterpart, so I can access some unstable functions in std to updateCommand
, but tokio only provides anas_std
method returning a shared reference.Describe the solution you'd like
Add a
tokio::process::Command::as_std_mut()
method, maybe like:Describe alternatives you've considered
Implement
From<tokio::process::Command>
forstd::process::Command
? But we may lose information such askill_on_drop
.Implement
tokio::process::Command::groups()
method. Seems like a better solution, but I may want to use other functions as well in the future.Additional context
The text was updated successfully, but these errors were encountered: