Skip to main content

CommandRunner

Trait CommandRunner 

Source
pub trait CommandRunner: Send + Sync {
    // Required method
    fn run<'life0, 'life1, 'async_trait>(
        &'life0 self,
        program: &'static str,
        args: &'life1 [String],
    ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided method
    fn run_ignoring_status<'life0, 'life1, 'async_trait>(
        &'life0 self,
        program: &'static str,
        args: &'life1 [String],
    ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}
Expand description

Runs a CLI and returns its stdout.

Required Methods§

Source

fn run<'life0, 'life1, 'async_trait>( &'life0 self, program: &'static str, args: &'life1 [String], ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

program is a static name (e.g. "gh") so a missing binary can be reported precisely; args is the full argument vector.

Provided Methods§

Source

fn run_ignoring_status<'life0, 'life1, 'async_trait>( &'life0 self, program: &'static str, args: &'life1 [String], ) -> Pin<Box<dyn Future<Output = Result<String>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Stdout regardless of the exit status. gh api exits 1 on a 304 Not Modified, which is the successful answer to a conditional request, and the response it wrote to stdout is the part that matters.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§