mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-16 00:00:12 +02:00
process: add as_std() method to Command (#4295)
This commit is contained in:
@@ -264,6 +264,12 @@ impl Command {
|
|||||||
Self::from(StdCommand::new(program))
|
Self::from(StdCommand::new(program))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Cheaply convert to a `&std::process::Command` for places where the type from the standard
|
||||||
|
/// library is expected.
|
||||||
|
pub fn as_std(&self) -> &StdCommand {
|
||||||
|
&self.std
|
||||||
|
}
|
||||||
|
|
||||||
/// Adds an argument to pass to the program.
|
/// Adds an argument to pass to the program.
|
||||||
///
|
///
|
||||||
/// Only one argument can be passed per use. So instead of:
|
/// Only one argument can be passed per use. So instead of:
|
||||||
|
|||||||
@@ -26,7 +26,11 @@ pub struct Handle {
|
|||||||
|
|
||||||
/// Handles to the signal drivers
|
/// Handles to the signal drivers
|
||||||
#[cfg_attr(
|
#[cfg_attr(
|
||||||
not(any(feature = "signal", all(unix, feature = "process"))),
|
any(
|
||||||
|
loom,
|
||||||
|
not(all(unix, feature = "signal")),
|
||||||
|
not(all(unix, feature = "process")),
|
||||||
|
),
|
||||||
allow(dead_code)
|
allow(dead_code)
|
||||||
)]
|
)]
|
||||||
pub(super) signal_handle: driver::SignalHandle,
|
pub(super) signal_handle: driver::SignalHandle,
|
||||||
|
|||||||
Reference in New Issue
Block a user