[−][src]Struct bossy::Command
Build and run commands to your heart's content.
Methods
impl Command
[src]
pub fn impure(name: impl AsRef<OsStr>) -> Self
[src]
Start building a command that inherits all env vars from the environment.
pub fn pure(name: impl AsRef<OsStr>) -> Self
[src]
Start building a command with a completely clean environment. Note that
at minimum, you'll often want to add PATH
and TERM
to the environment
for things to function as expected.
pub fn display(&self) -> &str
[src]
Get the command's string representation.
pub fn set_stdin(&mut self, cfg: impl Into<Stdio>) -> &mut Self
[src]
pub fn with_stdin(self, cfg: impl Into<Stdio>) -> Self
[src]
pub fn set_stdin_piped(&mut self) -> &mut Self
[src]
pub fn with_stdin_piped(self) -> Self
[src]
pub fn set_stdout(&mut self, cfg: impl Into<Stdio>) -> &mut Self
[src]
pub fn with_stdout(self, cfg: impl Into<Stdio>) -> Self
[src]
pub fn set_stdout_piped(&mut self) -> &mut Self
[src]
pub fn with_stdout_piped(self) -> Self
[src]
pub fn set_stderr(&mut self, cfg: impl Into<Stdio>) -> &mut Self
[src]
pub fn with_stderr(self, cfg: impl Into<Stdio>) -> Self
[src]
pub fn set_stderr_piped(&mut self) -> &mut Self
[src]
pub fn with_stderr_piped(self) -> Self
[src]
pub fn add_env_var(
&mut self,
key: impl AsRef<OsStr>,
val: impl AsRef<OsStr>
) -> &mut Self
[src]
&mut self,
key: impl AsRef<OsStr>,
val: impl AsRef<OsStr>
) -> &mut Self
pub fn with_env_var(
self,
key: impl AsRef<OsStr>,
val: impl AsRef<OsStr>
) -> Self
[src]
self,
key: impl AsRef<OsStr>,
val: impl AsRef<OsStr>
) -> Self
pub fn add_env_vars(
&mut self,
vars: impl IntoIterator<Item = (impl AsRef<OsStr>, impl AsRef<OsStr>)>
) -> &mut Self
[src]
&mut self,
vars: impl IntoIterator<Item = (impl AsRef<OsStr>, impl AsRef<OsStr>)>
) -> &mut Self
pub fn with_env_vars(
self,
vars: impl IntoIterator<Item = (impl AsRef<OsStr>, impl AsRef<OsStr>)>
) -> Self
[src]
self,
vars: impl IntoIterator<Item = (impl AsRef<OsStr>, impl AsRef<OsStr>)>
) -> Self
pub fn add_arg(&mut self, name: impl AsRef<OsStr>) -> &mut Self
[src]
pub fn with_arg(self, name: impl AsRef<OsStr>) -> Self
[src]
pub fn add_args(
&mut self,
args: impl IntoIterator<Item = impl AsRef<OsStr>>
) -> &mut Self
[src]
&mut self,
args: impl IntoIterator<Item = impl AsRef<OsStr>>
) -> &mut Self
pub fn with_args(
self,
args: impl IntoIterator<Item = impl AsRef<OsStr>>
) -> Self
[src]
self,
args: impl IntoIterator<Item = impl AsRef<OsStr>>
) -> Self
pub fn run(&mut self) -> Result<Handle>
[src]
Run the command and give you a delightful Handle
to it. This allows
you to decide when blocking should happen, but if you don't care, then
Command::run_and_wait
and Command::run_and_wait_for_output
are
better picks.
pub fn run_and_wait(&mut self) -> Result<ExitStatus>
[src]
Run the command and block until it exits.
pub fn run_and_wait_for_output(&mut self) -> Result<Output>
[src]
Run the command and block until its output is collected. This will
automatically set stdout and stderr to use Stdio::piped
, so if you
don't want that to be happen, then you're screwed.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Command
impl Send for Command
impl !Sync for Command
impl Unpin for Command
impl !UnwindSafe for Command
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>,