pub trait BashOperations: Send + Sync {
// Required method
fn exec<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
command: &'life1 str,
cwd: &'life2 Path,
on_data: UnboundedSender<String>,
signal: Option<&'life3 Cancel>,
timeout: Option<u64>,
env: Option<HashMap<String, String>>,
) -> Pin<Box<dyn Future<Output = Result<Option<i32>, Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait;
}Expand description
Pluggable operations for the bash tool (matching pi’s BashOperations). Override these to delegate command execution to remote systems (for example SSH).
Required Methods§
Sourcefn exec<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
command: &'life1 str,
cwd: &'life2 Path,
on_data: UnboundedSender<String>,
signal: Option<&'life3 Cancel>,
timeout: Option<u64>,
env: Option<HashMap<String, String>>,
) -> Pin<Box<dyn Future<Output = Result<Option<i32>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn exec<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
command: &'life1 str,
cwd: &'life2 Path,
on_data: UnboundedSender<String>,
signal: Option<&'life3 Cancel>,
timeout: Option<u64>,
env: Option<HashMap<String, String>>,
) -> Pin<Box<dyn Future<Output = Result<Option<i32>, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Execute a command and stream output via the sender. Returns the exit code (0 = success, non-zero = error, None = killed).
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".