pub struct CommandExecutor {
pub raw_args: Vec<String>,
pub platform_info: Option<PlatformInfo>,
pub timeout: Option<Duration>,
}Expand description
Common functionality for executing Docker commands
Fields§
§raw_args: Vec<String>Additional raw arguments added via escape hatch
platform_info: Option<PlatformInfo>Platform information for runtime abstraction
timeout: Option<Duration>Optional timeout for command execution
Implementations§
Source§impl CommandExecutor
impl CommandExecutor
Sourcepub fn with_platform() -> Result<Self>
pub fn with_platform() -> Result<Self>
Create a new command executor with platform detection
§Errors
Returns an error if platform detection fails
Sourcepub fn platform(self, platform_info: PlatformInfo) -> Self
pub fn platform(self, platform_info: PlatformInfo) -> Self
Set the platform information
Sourcepub fn timeout(self, timeout: Duration) -> Self
pub fn timeout(self, timeout: Duration) -> Self
Set a timeout for command execution
If the command takes longer than the specified duration, it will be
terminated and an Error::Timeout will be returned.
Sourcepub fn timeout_secs(self, seconds: u64) -> Self
pub fn timeout_secs(self, seconds: u64) -> Self
Set a timeout in seconds for command execution
Sourcepub async fn execute_command(
&self,
command_name: &str,
args: Vec<String>,
) -> Result<CommandOutput>
pub async fn execute_command( &self, command_name: &str, args: Vec<String>, ) -> Result<CommandOutput>
Execute a Docker command with the given arguments
§Errors
Returns an error if the Docker command fails to execute, returns a non-zero exit code, or times out (if a timeout is configured)
Sourcepub fn add_option(&mut self, key: &str, value: &str)
pub fn add_option(&mut self, key: &str, value: &str)
Add a key-value option
Trait Implementations§
Source§impl Clone for CommandExecutor
impl Clone for CommandExecutor
Source§fn clone(&self) -> CommandExecutor
fn clone(&self) -> CommandExecutor
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 Debug for CommandExecutor
impl Debug for CommandExecutor
Auto Trait Implementations§
impl Freeze for CommandExecutor
impl RefUnwindSafe for CommandExecutor
impl Send for CommandExecutor
impl Sync for CommandExecutor
impl Unpin for CommandExecutor
impl UnwindSafe for CommandExecutor
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