Skip to main content

CommandExt

Trait CommandExt 

Source
pub trait CommandExt: Debug {
    // Required methods
    fn spawn_into(&mut self) -> Result<Child>;
    fn spawn_and_wait_for_stdout<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn spawn_and_wait<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn description(&self) -> String { ... }
}
Expand description

Extension trait for tokio::process::Command.

Required Methods§

Source

fn spawn_into(&mut self) -> Result<Child>

Similar to tokio::process::Command::spawn but sets kill_on_drop to true. Errors are tagged with a description of the command.

Source

fn spawn_and_wait_for_stdout<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Similar to tokio::process::Command::output but does not capture stderr and returns the stdout as a string. Errors are tagged with a description of the command.

Source

fn spawn_and_wait<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Spawns and waits for process to finish executing. Will not wait for stdout, use spawn_and_wait_for_stdout for that

Provided Methods§

Source

fn description(&self) -> String

Description used for error reporting.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl CommandExt for Command

Source§

fn spawn_into(&mut self) -> Result<Child>

Source§

fn spawn_and_wait_for_stdout<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn spawn_and_wait<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§