pub struct Command {
pub command: String,
pub args: Vec<String>,
pub env: Vec<(String, String)>,
}Expand description
A command.
Fields§
§command: StringThe command to execute.
args: Vec<String>The arguments to pass to the command.
env: Vec<(String, String)>The environment variables to set for the command.
Implementations§
Source§impl Command
impl Command
pub fn new(program: impl Into<String>) -> Self
pub fn arg(self, arg: impl Into<String>) -> Self
pub fn args(self, args: impl IntoIterator<Item = impl Into<String>>) -> Self
pub fn env(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn envs( self, envs: impl IntoIterator<Item = (impl Into<String>, impl Into<String>)>, ) -> Self
pub fn output(&mut self) -> Result<Output, String>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Command
impl RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnwindSafe for Command
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