Skip to main content

CommandExecute

Trait CommandExecute 

Source
pub trait CommandExecute:
    Debug
    + Send
    + Sync
    + 'static {
    // Required method
    fn command_execute<'a>(
        &'a self,
        program: &'a str,
        args: &'a [&'a str],
    ) -> impl Future<Output = Result<CommandOutput>> + MaybeSend + 'a;
}
Expand description

CommandExecute is used to execute external commands for credential retrieval.

This trait abstracts command execution to support different runtime environments:

  • Tokio-based async execution
  • Blocking execution for non-async contexts
  • WebAssembly environments (returning errors)
  • Mock implementations for testing

Required Methods§

Source

fn command_execute<'a>( &'a self, program: &'a str, args: &'a [&'a str], ) -> impl Future<Output = Result<CommandOutput>> + MaybeSend + 'a

Execute a command with the given program and arguments.

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.

Implementations on Foreign Types§

Source§

impl<T: CommandExecuteDyn + ?Sized> CommandExecute for Arc<T>

Source§

async fn command_execute( &self, program: &str, args: &[&str], ) -> Result<CommandOutput>

Implementors§