Skip to main content

RemoteShell

Trait RemoteShell 

Source
pub trait RemoteShell: Send + Sync {
    // Required method
    fn exec<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        args: &'life1 [&'life2 str],
        timeout_secs: Option<u64>,
    ) -> Pin<Box<dyn Future<Output = Result<ShellOutput, InfraError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;

    // Provided methods
    fn exec_script<'life0, 'life1, 'async_trait>(
        &'life0 self,
        script: &'life1 str,
        timeout_secs: Option<u64>,
    ) -> Pin<Box<dyn Future<Output = Result<ShellOutput, InfraError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn batch_inspect<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        root: &'life1 str,
        relative_paths: &'life2 [String],
    ) -> Pin<Box<dyn Future<Output = Result<Vec<FileInspection>, InfraError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
}
Expand description

Abstract shell for executing commands on a location’s host.

Required Methods§

Source

fn exec<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, args: &'life1 [&'life2 str], timeout_secs: Option<u64>, ) -> Pin<Box<dyn Future<Output = Result<ShellOutput, InfraError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Execute a command on this host.

args[0] is the program name, args[1..] are arguments.

Provided Methods§

Source

fn exec_script<'life0, 'life1, 'async_trait>( &'life0 self, script: &'life1 str, timeout_secs: Option<u64>, ) -> Pin<Box<dyn Future<Output = Result<ShellOutput, InfraError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Execute a shell script on this host.

Default: exec(&["sh", "-c", script]). Remote shells may override to use file-based transfer (SCP) to avoid shell escaping issues with SSH.

Source

fn batch_inspect<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, root: &'life1 str, relative_paths: &'life2 [String], ) -> Pin<Box<dyn Future<Output = Result<Vec<FileInspection>, InfraError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Batch inspect files: get sha256 + size for ALL paths in one exec call.

Constructs a single shell script that processes every file in the list and outputs <sha256> <size> <relative_path> per line. Parsed on return.

Timeout scales with file count: base 30s + 2s per file.

Implementors§