Struct EasyCommand

Source
pub struct EasyCommand { /* private fields */ }
Expand description

A convenience API around Command.

Implementations§

Source§

impl EasyCommand

Source

pub fn new<C>(cmd: C) -> Self
where C: AsRef<OsStr>,

Equivalent to Command::new.

Source

pub fn new_with<C>(cmd: C, f: impl FnOnce(&mut Command) -> &mut Command) -> Self
where C: AsRef<OsStr>,

A convenience constructor that allows other method calls to be chained onto this one.

Source

pub fn simple<C, A, I>(cmd: C, args: I) -> Self
where C: AsRef<OsStr>, A: AsRef<OsStr>, I: IntoIterator<Item = A>,

Like Self::new_with, but optimized for ergonomic usage of an IntoIterator for arguments.

Source

pub fn spawn_and_wait( &mut self, ) -> Result<ExitStatus, ExecuteError<SpawnAndWaitErrorKind>>

Execute this command, returning its exit status.

This command wraps around Command::spawn, which causes stdout and stderr to be inherited from its parent.

Source

pub fn run(&mut self) -> Result<(), ExecuteError<RunErrorKind>>

Execute this command, returning an error if it did not return a successful exit code.

This command wraps around Command::spawn, which causes stdout and stderr to be inherited from its parent.

Source

pub fn output(&mut self) -> Result<Output, ExecuteError<Error>>

Execute this command, capturing its output.

Trait Implementations§

Source§

impl Debug for EasyCommand

Source§

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

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

impl Display for EasyCommand

Source§

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

Formats the value using the given formatter. Read more

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> 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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.