Skip to main content

GcloudExecutor

Trait GcloudExecutor 

Source
pub trait GcloudExecutor: Send + Sync {
    // Required methods
    async fn exec(&self, args: &[String]) -> Result<String, GcloudError>;
    async fn exec_streaming(&self, args: &[String]) -> Result<(), GcloudError>;
    async fn exec_with_stdin(
        &self,
        args: &[String],
        stdin_data: &[u8],
    ) -> Result<String, GcloudError>;
}
Expand description

Abstraction over gcloud CLI execution for testability.

Production code uses RealExecutor, tests use mockall-generated mocks.

Required Methods§

Source

async fn exec(&self, args: &[String]) -> Result<String, GcloudError>

Execute a gcloud command and capture stdout.

Source

async fn exec_streaming(&self, args: &[String]) -> Result<(), GcloudError>

Execute a gcloud command, streaming output to the terminal.

Source

async fn exec_with_stdin( &self, args: &[String], stdin_data: &[u8], ) -> Result<String, GcloudError>

Execute a gcloud command with data piped to stdin.

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§