Skip to main content

Shell

Trait Shell 

Source
pub trait Shell: Send + Sync {
    // Required methods
    fn exec<'a, 'life0, 'async_trait>(
        &'a self,
        command: &'life0 str,
        options: ShellExecOptions<'a>,
    ) -> Pin<Box<dyn Future<Output = Result<ShellOutput, ExecutionError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'a: 'async_trait,
             'life0: 'async_trait;
    fn cleanup<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Mirrors TS Shell.

Required Methods§

Source

fn exec<'a, 'life0, 'async_trait>( &'a self, command: &'life0 str, options: ShellExecOptions<'a>, ) -> Pin<Box<dyn Future<Output = Result<ShellOutput, ExecutionError>> + Send + 'async_trait>>
where Self: 'async_trait, 'a: 'async_trait, 'life0: 'async_trait,

Execute command in a bash shell. The TS env resolves a bash binary (git-bash on Windows, /bin/bash on POSIX, /bin/sh fallback on POSIX). There is NO cmd.exe fallback on Windows — failure to find bash is ExecutionError::ShellUnavailable.

Source

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

Best-effort, never returns Err. Mirrors TS Shell.cleanup.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§