pub struct Command { /* private fields */ }Expand description
Builder for spawning a child process.
Mirrors std::process::Command. The program is searched on PATH
(via posix_spawnp). The child inherits the parent’s environment.
§Example
let child = ringline::process::Command::new("grep")
.arg("-r")
.arg("pattern")
.arg("src/")
.spawn()?
.await?;
let status = child.wait()?.await?;Implementations§
Source§impl Command
impl Command
Sourcepub fn args(self, args: impl IntoIterator<Item = impl Into<String>>) -> Self
pub fn args(self, args: impl IntoIterator<Item = impl Into<String>>) -> Self
Add multiple arguments.
Sourcepub fn spawn(self) -> Result<SpawnFuture>
pub fn spawn(self) -> Result<SpawnFuture>
Spawn the command.
Returns a future that resolves to a Child once the spawner pool
has created the process and obtained its pidfd.
Auto Trait Implementations§
impl Freeze for Command
impl RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnsafeUnpin for Command
impl UnwindSafe for Command
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more