Struct portable_pty::cmdbuilder::CommandBuilder [−][src]
pub struct CommandBuilder { /* fields omitted */ }
CommandBuilder
is used to prepare a command to be spawned into a pty.
The interface is intentionally similar to that of std::process::Command
.
Implementations
impl CommandBuilder
[src]
impl CommandBuilder
[src]pub fn new<S: AsRef<OsStr>>(program: S) -> Self
[src]
Create a new builder instance with argv[0] set to the specified program.
pub fn from_argv(args: Vec<OsString>) -> Self
[src]
Create a new builder instance from a pre-built argument vector
pub fn new_default_prog() -> Self
[src]
Create a new builder instance that will run some idea of a default
program. Such a builder will panic if arg
is called on it.
pub fn is_default_prog(&self) -> bool
[src]
Returns true if this builder was created via new_default_prog
pub fn arg<S: AsRef<OsStr>>(&mut self, arg: S)
[src]
Append an argument to the current command line.
Will panic if called on a builder created via new_default_prog
.
pub fn args<I, S>(&mut self, args: I) where
I: IntoIterator<Item = S>,
S: AsRef<OsStr>,
[src]
I: IntoIterator<Item = S>,
S: AsRef<OsStr>,
Append a sequence of arguments to the current command line
pub fn env<K, V>(&mut self, key: K, val: V) where
K: AsRef<OsStr>,
V: AsRef<OsStr>,
[src]
K: AsRef<OsStr>,
V: AsRef<OsStr>,
Override the value of an environmental variable
pub fn cwd<D>(&mut self, dir: D) where
D: AsRef<OsStr>,
[src]
D: AsRef<OsStr>,
pub fn get_cwd(&self) -> Option<&OsString>
[src]
pub fn iter_env_as_str(&self) -> impl Iterator<Item = (&str, &str)>
[src]
Iterate over the configured environment
pub fn as_unix_command_line(&self) -> Result<String>
[src]
Return the configured command and arguments as a single string, quoted per the unix shell conventions.
Trait Implementations
impl PartialEq<CommandBuilder> for CommandBuilder
[src]
impl PartialEq<CommandBuilder> for CommandBuilder
[src]fn eq(&self, other: &CommandBuilder) -> bool
[src]
fn ne(&self, other: &CommandBuilder) -> bool
[src]
impl StructuralPartialEq for CommandBuilder
[src]
impl StructuralPartialEq for CommandBuilder
[src]Auto Trait Implementations
impl RefUnwindSafe for CommandBuilder
impl RefUnwindSafe for CommandBuilder
impl Send for CommandBuilder
impl Send for CommandBuilder
impl Sync for CommandBuilder
impl Sync for CommandBuilder
impl Unpin for CommandBuilder
impl Unpin for CommandBuilder
impl UnwindSafe for CommandBuilder
impl UnwindSafe for CommandBuilder