use std::ffi::OsStr;
use std::io;
use std::os::unix::process::CommandExt as _;
use crate::Command;
pub trait CommandExt: crate::sealed::Sealed {
fn uid(&mut self, id: u32) -> &mut Command;
fn gid(&mut self, id: u32) -> &mut Command;
fn exec(&mut self) -> io::Error;
fn arg0<S>(&mut self, arg: S) -> &mut Command
where
S: AsRef<OsStr>;
}
impl crate::sealed::Sealed for Command {}
impl CommandExt for Command {
fn uid(&mut self, id: u32) -> &mut Command {
self.inner.uid(id);
self
}
fn gid(&mut self, id: u32) -> &mut Command {
self.inner.gid(id);
self
}
fn exec(&mut self) -> io::Error {
self.inner.exec()
}
fn arg0<S>(&mut self, arg: S) -> &mut Command
where
S: AsRef<OsStr>,
{
self.inner.arg0(arg);
self
}
}