[−][src]Struct subprocess::PopenConfig
Options for Popen::create
.
When constructing PopenConfig
, always use the Default
trait,
such as:
Popen::create(argv, PopenConfig { stdout: Redirection::Pipe, detached: true, // ... other fields you want to override ... ..Default::default() })
This ensures that fields added later do not break existing code.
An alternative to using PopenConfig
directly is creating
processes using Exec
, a builder for Popen
.
Fields
stdin: Redirection
How to configure the executed program's standard input.
stdout: Redirection
How to configure the executed program's standard output.
stderr: Redirection
How to configure the executed program's standard error.
detached: bool
Whether the Popen
instance is initially detached.
executable: Option<OsString>
Executable to run.
If provided, this executable will be used to run the program
instead of argv[0]
. However, argv[0]
will still be passed
to the subprocess, which will see that as argv[0]
. On some
Unix systems, ps
will show the string passed as argv[0]
,
even though executable
is actually running.
env: Option<Vec<(OsString, OsString)>>
Environment variables to pass to the subprocess.
If this is None, environment variables are inherited from the calling process. Otherwise, the specified variables are used instead.
Duplicates are eliminated, with the value taken from the variable appearing later in the vector.
cwd: Option<OsString>
Initial current working directory of the subprocess.
None means inherit the working directory from the parent.
Methods
impl PopenConfig
[src]
pub fn try_clone(&self) -> IoResult<PopenConfig>
[src]
Clone the underlying PopenConfig
, or return an error.
This is guaranteed not to fail as long as no
Redirection::File
variant is used for one of the standard
streams. Otherwise, it fails if File::try_clone
fails on
one of the Redirection
s.
pub fn current_env() -> Vec<(OsString, OsString)>
[src]
Returns the environment of the current process.
The returned value is in the format accepted by the env
member of PopenConfig
.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for PopenConfig
impl !Send for PopenConfig
impl !Sync for PopenConfig
impl Unpin for PopenConfig
impl UnwindSafe for PopenConfig
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,