CommandInstruction

Struct CommandInstruction 

Source
pub struct CommandInstruction {
    pub builder: bool,
    pub args: Vec<String>,
    pub env: FxHashMap<String, String>,
    pub exe: String,
    pub cwd: Option<PathBuf>,
}
Expand description

A command and its parameters to be executed as a child process.

Fields§

§builder: bool

If the executable should reference a builder executable.

§args: Vec<String>

List of arguments.

§env: FxHashMap<String, String>

Map of environment variables.

§exe: String

The executable on PATH.

§cwd: Option<PathBuf>

The working directory.

Implementations§

Source§

impl CommandInstruction

Source

pub fn builder(self, value: bool) -> Self

Sets the builder field of this struct.

Source

pub fn args(self, value: Vec<String>) -> Self

Sets the args field of this struct.

Source

pub fn env(self, value: FxHashMap<String, String>) -> Self

Sets the env field of this struct.

Source

pub fn exe(self, value: impl Into<String>) -> Self

Sets the exe field of this struct.

Source

pub fn cwd(self, value: PathBuf) -> Self

Sets the cwd field of this struct.

Source§

impl CommandInstruction

Source

pub fn new<T: AsRef<str>, I: IntoIterator<Item = V>, V: AsRef<str>>( exe: T, args: I, ) -> Self

Create a new command with the executable and arguments.

Source

pub fn with_builder<T: AsRef<str>, I: IntoIterator<Item = V>, V: AsRef<str>>( id: T, args: I, ) -> Self

Create a new command that executes an executable from a builder with the arguments.

Trait Implementations§

Source§

impl Clone for CommandInstruction

Source§

fn clone(&self) -> CommandInstruction

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CommandInstruction

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for CommandInstruction

Source§

fn default() -> CommandInstruction

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for CommandInstruction

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for CommandInstruction

Source§

fn eq(&self, other: &CommandInstruction) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for CommandInstruction

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for CommandInstruction

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,