tokio-rs / tokio

A runtime for writing reliable asynchronous applications with Rust. Provides I/O, networking, scheduling, timers, ...
https://tokio.rs
MIT License
25.71k stars 2.35k forks source link

Added method as_std_mut to tokio::process::Command #6608

Closed tglane closed 1 month ago

tglane commented 1 month ago

Motivation

Citing from #6523:

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 update Command, but tokio only provides an as_std method returning a shared reference.

Solution

I added a method as_std_mut(&mut self) -> &mut std::process::Command to tokio::process::Command to get mutable access to the inner std command structure.

This closes #6523