* allow using a TokioCommandWrap for TokioChildProcess::new closes #243 TokioCommandWrap implements From<tokio::process::Command> so this is not a breaking change, but also downstream users have more control over flags such as KillOnDrop and CreationFlags see https://docs.rs/process-wrap/latest/process_wrap/#killondrop-and-creationflags
This commit is contained in:
parent
37b4ddb35d
commit
db03f63e76
1 changed files with 4 additions and 3 deletions
|
|
@ -59,11 +59,12 @@ impl AsyncRead for TokioChildProcessOut {
|
|||
}
|
||||
|
||||
impl TokioChildProcess {
|
||||
pub fn new(mut command: tokio::process::Command) -> std::io::Result<Self> {
|
||||
command
|
||||
pub fn new(command: impl Into<TokioCommandWrap>) -> std::io::Result<Self> {
|
||||
let mut command_wrap = command.into();
|
||||
command_wrap
|
||||
.command_mut()
|
||||
.stdin(std::process::Stdio::piped())
|
||||
.stdout(std::process::Stdio::piped());
|
||||
let mut command_wrap = TokioCommandWrap::from(command);
|
||||
#[cfg(unix)]
|
||||
command_wrap.wrap(process_wrap::tokio::ProcessGroup::leader());
|
||||
#[cfg(windows)]
|
||||
|
|
|
|||
Loading…
Reference in a new issue