Struct xshell::Cmd [−][src]
#[must_use]pub struct Cmd { /* fields omitted */ }
Expand description
A command.
Implementations
impl Cmd
[src]
impl Cmd
[src]pub fn args<I>(self, args: I) -> Cmd where
I: IntoIterator,
I::Item: AsRef<OsStr>,
[src]
pub fn args<I>(self, args: I) -> Cmd where
I: IntoIterator,
I::Item: AsRef<OsStr>,
[src]Pushes the arguments onto this Cmd
.
pub fn env<K, V>(self, key: K, val: V) -> Cmd where
K: AsRef<OsStr>,
V: AsRef<OsStr>,
[src]
pub fn env<K, V>(self, key: K, val: V) -> Cmd where
K: AsRef<OsStr>,
V: AsRef<OsStr>,
[src]Equivalent to std::process::Command::env
.
pub fn envs<I, K, V>(self, vars: I) -> Cmd where
I: IntoIterator<Item = (K, V)>,
K: AsRef<OsStr>,
V: AsRef<OsStr>,
[src]
pub fn envs<I, K, V>(self, vars: I) -> Cmd where
I: IntoIterator<Item = (K, V)>,
K: AsRef<OsStr>,
V: AsRef<OsStr>,
[src]Equivalent to std::process::Command::envs
.
Note: This does not replace the child process’s environment, unless you
call Cmd::env_clear
first.
pub fn env_remove<K>(self, key: K) -> Cmd where
K: AsRef<OsStr>,
[src]
pub fn env_remove<K>(self, key: K) -> Cmd where
K: AsRef<OsStr>,
[src]Equivalent to std::process::Command::env_remove
.
pub fn env_clear(self) -> Cmd
[src]
pub fn env_clear(self) -> Cmd
[src]Equivalent to std::process::Command::env_clear
.
Note that on Windows some environmental variables are required for process spawning. See https://github.com/rust-lang/rust/issues/31259.
pub fn ignore_stdout(self) -> Cmd
[src]
pub fn ignore_stdout(self) -> Cmd
[src]Returns a Cmd
that will ignore the stdout stream. This is equivalent of
attaching stdout to /dev/null
.
pub fn ignore_stderr(self) -> Cmd
[src]
pub fn ignore_stderr(self) -> Cmd
[src]Returns a Cmd
that will ignore the stderr stream. This is equivalent of
attaching stderr to /dev/null
.
pub fn ignore_status(self) -> Cmd
[src]
pub fn ignore_status(self) -> Cmd
[src]Returns a Cmd
that ignores its exit status.
pub fn echo_cmd(self, echo: bool) -> Cmd
[src]
pub fn echo_cmd(self, echo: bool) -> Cmd
[src]Returns a Cmd
that echoes itself (or not) as specified.
pub fn secret(self, secret: bool) -> Cmd
[src]
pub fn secret(self, secret: bool) -> Cmd
[src]Returns a Cmd
that is secret (or not) as specified.
If a command is secret, it echoes <secret>
instead of the program and
its arguments.
pub fn read_stderr(self) -> Result<String>
[src]
pub fn read_stderr(self) -> Result<String>
[src]Returns the stderr from running the command.
pub fn output(self) -> Result<Output>
[src]
pub fn output(self) -> Result<Output>
[src]Returns a std::process::Output
from running the command.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Cmd
impl Send for Cmd
impl Sync for Cmd
impl Unpin for Cmd
impl UnwindSafe for Cmd
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more