pub struct ComposeExecCommand {
pub executor: CommandExecutor,
pub config: ComposeConfig,
pub service: String,
pub command: Vec<String>,
pub detach: bool,
pub no_tty: bool,
pub interactive: bool,
pub user: Option<String>,
pub workdir: Option<String>,
pub env: HashMap<String, String>,
pub index: Option<u32>,
pub privileged: bool,
}
Expand description
Docker Compose exec command builder
Fields§
§executor: CommandExecutor
Base command executor
config: ComposeConfig
Base compose configuration
service: String
Service to execute command in
command: Vec<String>
Command and arguments to execute
detach: bool
Run in detached mode
no_tty: bool
Disable pseudo-TTY allocation
interactive: bool
Keep STDIN open even if not attached
user: Option<String>
Run as specified user
workdir: Option<String>
Working directory inside the container
env: HashMap<String, String>
Set environment variables
index: Option<u32>
Container index (if service has multiple instances)
privileged: bool
Use privileged mode
Implementations§
Source§impl ComposeExecCommand
impl ComposeExecCommand
Sourcepub fn interactive(self) -> Self
pub fn interactive(self) -> Self
Keep STDIN open even if not attached
Sourcepub fn workdir(self, workdir: impl Into<String>) -> Self
pub fn workdir(self, workdir: impl Into<String>) -> Self
Set working directory inside the container
Sourcepub fn env(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn env(self, key: impl Into<String>, value: impl Into<String>) -> Self
Set an environment variable
Sourcepub fn envs(self, env_vars: HashMap<String, String>) -> Self
pub fn envs(self, env_vars: HashMap<String, String>) -> Self
Set multiple environment variables
Sourcepub fn index(self, index: u32) -> Self
pub fn index(self, index: u32) -> Self
Set container index (for services with multiple instances)
Sourcepub fn privileged(self) -> Self
pub fn privileged(self) -> Self
Use privileged mode
Trait Implementations§
Source§impl Clone for ComposeExecCommand
impl Clone for ComposeExecCommand
Source§fn clone(&self) -> ComposeExecCommand
fn clone(&self) -> ComposeExecCommand
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl ComposeCommand for ComposeExecCommand
impl ComposeCommand for ComposeExecCommand
Source§fn get_config(&self) -> &ComposeConfig
fn get_config(&self) -> &ComposeConfig
Get the compose configuration
Source§fn get_config_mut(&mut self) -> &mut ComposeConfig
fn get_config_mut(&mut self) -> &mut ComposeConfig
Get mutable compose configuration for builder pattern
Source§fn subcommand(&self) -> &'static str
fn subcommand(&self) -> &'static str
Get the compose subcommand name (e.g., “up”, “down”, “ps”)
Source§fn build_subcommand_args(&self) -> Vec<String>
fn build_subcommand_args(&self) -> Vec<String>
Build command-specific arguments (without global compose args)
Source§fn build_command_args(&self) -> Vec<String>
fn build_command_args(&self) -> Vec<String>
Build complete command arguments including “compose” and global args
(This provides the implementation for
(This provides the implementation for
DockerCommandV2::build_command_args
)Source§impl Debug for ComposeExecCommand
impl Debug for ComposeExecCommand
Source§impl DockerCommand for ComposeExecCommand
impl DockerCommand for ComposeExecCommand
Source§type Output = ComposeExecResult
type Output = ComposeExecResult
The output type this command produces
Source§fn get_executor(&self) -> &CommandExecutor
fn get_executor(&self) -> &CommandExecutor
Get the command executor for extensibility
Source§fn get_executor_mut(&mut self) -> &mut CommandExecutor
fn get_executor_mut(&mut self) -> &mut CommandExecutor
Get mutable command executor for extensibility
Source§fn build_command_args(&self) -> Vec<String>
fn build_command_args(&self) -> Vec<String>
Build the complete command arguments including subcommands
Source§fn execute<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Self::Output>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Self::Output>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Execute the command and return the typed output
Source§fn execute_command<'life0, 'async_trait>(
&'life0 self,
command_args: Vec<String>,
) -> Pin<Box<dyn Future<Output = Result<CommandOutput>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
fn execute_command<'life0, 'async_trait>(
&'life0 self,
command_args: Vec<String>,
) -> Pin<Box<dyn Future<Output = Result<CommandOutput>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
Helper method to execute the command with proper error handling
Source§fn arg<S: AsRef<OsStr>>(&mut self, arg: S) -> &mut Self
fn arg<S: AsRef<OsStr>>(&mut self, arg: S) -> &mut Self
Add a raw argument to the command (escape hatch)
Auto Trait Implementations§
impl Freeze for ComposeExecCommand
impl RefUnwindSafe for ComposeExecCommand
impl Send for ComposeExecCommand
impl Sync for ComposeExecCommand
impl Unpin for ComposeExecCommand
impl UnwindSafe for ComposeExecCommand
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more