pub struct OwnedCommand { /* private fields */ }Implementations§
Source§impl OwnedCommand
impl OwnedCommand
pub fn new(program: impl AsRef<OsStr>) -> Self
Sourcepub fn from_command(command: Command) -> Self
pub fn from_command(command: Command) -> Self
GUI/service children are hidden on Windows by default.
pub fn command_mut(&mut self) -> &mut Command
Sourcepub fn inherit_handles_only(
&mut self,
handles: impl IntoIterator<Item = RawHandleOrFd>,
) -> &mut Self
pub fn inherit_handles_only( &mut self, handles: impl IntoIterator<Item = RawHandleOrFd>, ) -> &mut Self
Inherit only these handles/fds plus configured stdio; values stay caller-owned.
Sourcepub fn env_allowlist<I, S>(&mut self, keys: I) -> &mut Self
pub fn env_allowlist<I, S>(&mut self, keys: I) -> &mut Self
Clear environment, then copy only named variables set in this process.
pub fn env_strip<I, S>(&mut self, keys: I) -> &mut Self
Sourcepub fn windows_hide(&mut self) -> &mut Self
pub fn windows_hide(&mut self) -> &mut Self
Compatibility no-op: hidden is already the default.
Sourcepub fn job_assignment_mode(&mut self, mode: JobAssignmentMode) -> &mut Self
pub fn job_assignment_mode(&mut self, mode: JobAssignmentMode) -> &mut Self
Ignored on Unix. BestEffort reports errors on OwnedChild.
Sourcepub fn unix_containment(&mut self, mode: UnixContainment) -> &mut Self
pub fn unix_containment(&mut self, mode: UnixContainment) -> &mut Self
Ignored on Windows. Session runs setsid before exec.
Sourcepub fn partial_spawn_cleanup_timeout(&mut self, timeout: Duration) -> &mut Self
pub fn partial_spawn_cleanup_timeout(&mut self, timeout: Duration) -> &mut Self
Bound failed-spawn cleanup. Timed-out children go to a background reaper.
pub fn spawn(self) -> Result<OwnedChild>
Sourcepub fn spawn_uncontained_detached(self) -> Result<OwnedChild>
pub fn spawn_uncontained_detached(self) -> Result<OwnedChild>
Shared launch with no owner job or terminate-on-drop. Unix uses setsid; Windows requires breakaway and never falls back when escape is denied. Stdio follows Command: dropping piped stdin can still deliver EOF.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for OwnedCommand
impl !UnwindSafe for OwnedCommand
impl Freeze for OwnedCommand
impl Send for OwnedCommand
impl Sync for OwnedCommand
impl Unpin for OwnedCommand
impl UnsafeUnpin for OwnedCommand
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