pub struct Cmd<S: CmdString = OsString>(/* private fields */);
Expand description
A command.
Implementations§
source§impl<S: CmdString> Cmd<S>
impl<S: CmdString> Cmd<S>
sourcepub fn stdout(&self) -> Option<&Out>
pub fn stdout(&self) -> Option<&Out>
Indicates what to do with the stdout
output of the command.
sourcepub fn stderr(&self) -> Option<&Out>
pub fn stderr(&self) -> Option<&Out>
Indicates what to do with the stderr
output of the command.
sourcepub fn add_arg<A: AsRef<S::Str>>(&mut self, arg: A) -> &mut Self
pub fn add_arg<A: AsRef<S::Str>>(&mut self, arg: A) -> &mut Self
Adds an argument to the command.
sourcepub fn extend_args<A: AsRef<S::Str>, I: IntoIterator<Item = A>>(
&mut self,
args: I
) -> &mut Self
pub fn extend_args<A: AsRef<S::Str>, I: IntoIterator<Item = A>>( &mut self, args: I ) -> &mut Self
Extends the arguments of the command.
sourcepub fn with_cwd<P: AsRef<S::Str>>(self, cwd: P) -> Self
pub fn with_cwd<P: AsRef<S::Str>>(self, cwd: P) -> Self
Sets the directory in which to run the command.
sourcepub fn with_vars(self, vars: Vars<S>) -> Self
pub fn with_vars(self, vars: Vars<S>) -> Self
Sets the environment variables to run the command with.
sourcepub fn with_var<N: AsRef<S::Str>, V: AsRef<S::Str>>(
self,
name: N,
value: V
) -> Self
pub fn with_var<N: AsRef<S::Str>, V: AsRef<S::Str>>( self, name: N, value: V ) -> Self
Sets an environment variable.
sourcepub fn with_stdin<T: Into<In>>(self, stdin: T) -> Self
pub fn with_stdin<T: Into<In>>(self, stdin: T) -> Self
Sets the stdin
input to provide to the command.
sourcepub fn with_stdout(self, stdout: Out) -> Self
pub fn with_stdout(self, stdout: Out) -> Self
Sets what to do with the stdout
output of the command.
sourcepub fn with_stderr(self, stderr: Out) -> Self
pub fn with_stderr(self, stderr: Out) -> Self
Sets what to do with the stderr
output of the command.
sourcepub fn allow_failures(self) -> Self
pub fn allow_failures(self) -> Self
Do not return an error when the command fails.
sourcepub fn make_secret(self) -> Self
pub fn make_secret(self) -> Self
Mark the command as secret.
Trait Implementations§
source§impl<'de, S> Deserialize<'de> for Cmd<S>where
S: Deserialize<'de> + CmdString,
impl<'de, S> Deserialize<'de> for Cmd<S>where
S: Deserialize<'de> + CmdString,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl<S> RefUnwindSafe for Cmd<S>where
S: RefUnwindSafe,
impl<S> Send for Cmd<S>
impl<S> Sync for Cmd<S>
impl<S> Unpin for Cmd<S>
impl<S> UnwindSafe for Cmd<S>where
S: RefUnwindSafe,
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