Struct ezcmd::EasyCommand
source · pub struct EasyCommand { /* private fields */ }
Expand description
A convenience API around Command
.
Implementations§
source§impl EasyCommand
impl EasyCommand
sourcepub fn new<C>(cmd: C) -> Selfwhere
C: AsRef<OsStr>,
pub fn new<C>(cmd: C) -> Selfwhere C: AsRef<OsStr>,
Equivalent to Command::new
.
sourcepub fn new_with<C>(cmd: C, f: impl FnOnce(&mut Command) -> &mut Command) -> Selfwhere
C: AsRef<OsStr>,
pub fn new_with<C>(cmd: C, f: impl FnOnce(&mut Command) -> &mut Command) -> Selfwhere C: AsRef<OsStr>,
A convenience constructor that allows other method calls to be chained onto this one.
sourcepub fn simple<C, A, I>(cmd: C, args: I) -> Selfwhere
C: AsRef<OsStr>,
A: AsRef<OsStr>,
I: IntoIterator<Item = A>,
pub fn simple<C, A, I>(cmd: C, args: I) -> Selfwhere C: AsRef<OsStr>, A: AsRef<OsStr>, I: IntoIterator<Item = A>,
Like Self::new_with
, but optimized for ergonomic usage of an IntoIterator
for
arguments.
sourcepub fn spawn_and_wait(
&mut self
) -> Result<ExitStatus, ExecuteError<SpawnAndWaitErrorKind>>
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.
sourcepub fn run(&mut self) -> Result<(), ExecuteError<RunErrorKind>>
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.
Trait Implementations§
source§impl Debug for EasyCommand
impl Debug for EasyCommand
Auto Trait Implementations§
impl !RefUnwindSafe for EasyCommand
impl Send for EasyCommand
impl Sync for EasyCommand
impl Unpin for EasyCommand
impl !UnwindSafe for EasyCommand
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