pub struct ChildCommand { /* private fields */ }Expand description
A command configuration for spawning a process inside a newly allocated PTY.
Implementations§
Source§impl ChildCommand
impl ChildCommand
Sourcepub fn new(program: impl Into<PathBuf>) -> Self
pub fn new(program: impl Into<PathBuf>) -> Self
Creates a PTY child command that will execute program.
Sourcepub fn arg0(self, arg0: impl Into<OsString>) -> Self
pub fn arg0(self, arg0: impl Into<OsString>) -> Self
Overrides argv[0] without changing the executable path.
Sourcepub fn env(self, key: impl Into<OsString>, value: impl Into<OsString>) -> Self
pub fn env(self, key: impl Into<OsString>, value: impl Into<OsString>) -> Self
Sets or overrides a process environment variable.
Sourcepub fn clear_env(self) -> Self
pub fn clear_env(self) -> Self
Clears the inherited process environment before applying explicit entries.
Sourcepub fn current_dir(self, path: impl Into<PathBuf>) -> Self
pub fn current_dir(self, path: impl Into<PathBuf>) -> Self
Sets the child working directory.
Sourcepub fn size(self, size: TerminalSize) -> Self
pub fn size(self, size: TerminalSize) -> Self
Sets an initial PTY size for the child process.
Sourcepub fn spawn(self) -> Result<SpawnedPty>
pub fn spawn(self) -> Result<SpawnedPty>
Spawns the configured command inside a newly allocated PTY.
Trait Implementations§
Source§impl Clone for ChildCommand
impl Clone for ChildCommand
Source§fn clone(&self) -> ChildCommand
fn clone(&self) -> ChildCommand
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ChildCommand
impl RefUnwindSafe for ChildCommand
impl Send for ChildCommand
impl Sync for ChildCommand
impl Unpin for ChildCommand
impl UnsafeUnpin for ChildCommand
impl UnwindSafe for ChildCommand
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