RunAsync

Trait RunAsync 

Source
pub trait RunAsync<S: CmdString + Send + Sync>: Sync {
    // Required method
    fn run(
        &self,
        cmd: Cmd<S>,
    ) -> impl Send + Future<Output = RunResult<RunOutput, S>>;

    // Provided methods
    fn read_str(
        &self,
        cmd: Cmd<S>,
    ) -> impl Send + Future<Output = RunResult<String, S>> { ... }
    fn read_bytes(
        &self,
        cmd: Cmd<S>,
    ) -> impl Send + Future<Output = RunResult<Vec<u8>, S>> { ... }
}
Available on crate feature async only.
Expand description

Trait for running commands asynchronously in an execution environment.

Required Methods§

Source

fn run( &self, cmd: Cmd<S>, ) -> impl Send + Future<Output = RunResult<RunOutput, S>>

Provided Methods§

Source

fn read_str( &self, cmd: Cmd<S>, ) -> impl Send + Future<Output = RunResult<String, S>>

Source

fn read_bytes( &self, cmd: Cmd<S>, ) -> impl Send + Future<Output = RunResult<Vec<u8>, S>>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl RunAsync<OsString> for LocalEnv

Available on crate feature tokio only.
Source§

impl RunAsync<OsString> for ParentEnv

Available on crate feature tokio only.