Skip to main content

OwnedCommand

Struct OwnedCommand 

Source
pub struct OwnedCommand { /* private fields */ }

Implementations§

Source§

impl OwnedCommand

Source

pub fn new(program: impl AsRef<OsStr>) -> Self

Source

pub fn from_command(command: Command) -> Self

GUI/service children are hidden on Windows by default.

Source

pub fn command_mut(&mut self) -> &mut Command

Source

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.

Source

pub fn env_allowlist<I, S>(&mut self, keys: I) -> &mut Self
where I: IntoIterator<Item = S>, S: AsRef<OsStr>,

Clear environment, then copy only named variables set in this process.

Source

pub fn env_strip<I, S>(&mut self, keys: I) -> &mut Self
where I: IntoIterator<Item = S>, S: AsRef<OsStr>,

Source

pub fn windows_hide(&mut self) -> &mut Self

Compatibility no-op: hidden is already the default.

Source

pub fn job_assignment_mode(&mut self, mode: JobAssignmentMode) -> &mut Self

Ignored on Unix. BestEffort reports errors on OwnedChild.

Source

pub fn unix_containment(&mut self, mode: UnixContainment) -> &mut Self

Ignored on Windows. Session runs setsid before exec.

Source

pub fn partial_spawn_cleanup_timeout(&mut self, timeout: Duration) -> &mut Self

Bound failed-spawn cleanup. Timed-out children go to a background reaper.

Source

pub fn spawn(self) -> Result<OwnedChild>

Source

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§

Source§

impl Debug for OwnedCommand

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.