DockerCommand

Trait DockerCommand 

Source
pub trait DockerCommand {
    type Output;

    // Required methods
    fn get_executor(&self) -> &CommandExecutor;
    fn get_executor_mut(&mut self) -> &mut CommandExecutor;
    fn build_command_args(&self) -> Vec<String>;
    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;

    // Provided methods
    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 arg<S: AsRef<OsStr>>(&mut self, arg: S) -> &mut Self { ... }
    fn args<I, S>(&mut self, args: I) -> &mut Self
       where I: IntoIterator<Item = S>,
             S: AsRef<OsStr> { ... }
    fn flag(&mut self, flag: &str) -> &mut Self { ... }
    fn option(&mut self, key: &str, value: &str) -> &mut Self { ... }
}
Expand description

Unified trait for all Docker commands (both regular and compose)

Required Associated Types§

Source

type Output

The output type this command produces

Required Methods§

Source

fn get_executor(&self) -> &CommandExecutor

Get the command executor for extensibility

Source

fn get_executor_mut(&mut self) -> &mut CommandExecutor

Get mutable command executor for extensibility

Source

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,

Execute the command and return the typed output

Provided Methods§

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,

Helper method to execute the command with proper error handling

Source

fn arg<S: AsRef<OsStr>>(&mut self, arg: S) -> &mut Self

Add a raw argument to the command (escape hatch)

Source

fn args<I, S>(&mut self, args: I) -> &mut Self
where I: IntoIterator<Item = S>, S: AsRef<OsStr>,

Add multiple raw arguments to the command (escape hatch)

Source

fn flag(&mut self, flag: &str) -> &mut Self

Add a flag option (e.g., –detach, –rm)

Source

fn option(&mut self, key: &str, value: &str) -> &mut Self

Add a key-value option (e.g., –name value, –env key=value)

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§

Source§

impl DockerCommand for AttachCommand

Source§

impl DockerCommand for BakeCommand

Source§

impl DockerCommand for BuildCommand

Source§

impl DockerCommand for BuilderBuildCommand

Source§

impl DockerCommand for BuilderPruneCommand

Source§

impl DockerCommand for CommitCommand

Source§

impl DockerCommand for ComposeAttachCommand

Source§

impl DockerCommand for ComposeBuildCommand

Source§

impl DockerCommand for ComposeCreateCommand

Source§

impl DockerCommand for ComposeDownCommand

Source§

impl DockerCommand for ComposeExecCommand

Source§

impl DockerCommand for ComposeKillCommand

Source§

impl DockerCommand for ComposeLogsCommand

Source§

impl DockerCommand for ComposeLsCommand

Source§

impl DockerCommand for ComposePauseCommand

Source§

impl DockerCommand for ComposePsCommand

Source§

impl DockerCommand for ComposeRestartCommand

Source§

impl DockerCommand for ComposeRmCommand

Source§

impl DockerCommand for ComposeRunCommand

Source§

impl DockerCommand for ComposeStartCommand

Source§

impl DockerCommand for ComposeStopCommand

Source§

impl DockerCommand for ComposeUnpauseCommand

Source§

impl DockerCommand for ComposeUpCommand

Source§

impl DockerCommand for ContainerPruneCommand

Source§

impl DockerCommand for ContextCreateCommand

Source§

impl DockerCommand for ContextInspectCommand

Source§

impl DockerCommand for ContextLsCommand

Source§

impl DockerCommand for ContextRmCommand

Source§

impl DockerCommand for ContextUpdateCommand

Source§

impl DockerCommand for ContextUseCommand

Source§

impl DockerCommand for CpCommand

Source§

impl DockerCommand for CreateCommand

Source§

impl DockerCommand for DiffCommand

Source§

impl DockerCommand for EventsCommand

Source§

impl DockerCommand for ExecCommand

Source§

impl DockerCommand for ExportCommand

Source§

impl DockerCommand for HistoryCommand

Source§

impl DockerCommand for ImagePruneCommand

Source§

impl DockerCommand for ImagesCommand

Source§

impl DockerCommand for ImportCommand

Source§

impl DockerCommand for InfoCommand

Source§

impl DockerCommand for InitCommand

Source§

impl DockerCommand for InspectCommand

Source§

impl DockerCommand for KillCommand

Source§

impl DockerCommand for LoadCommand

Source§

impl DockerCommand for LoginCommand

Source§

impl DockerCommand for LogoutCommand

Source§

impl DockerCommand for LogsCommand

Source§

impl DockerCommand for NetworkConnectCommand

Source§

impl DockerCommand for NetworkCreateCommand

Source§

impl DockerCommand for NetworkDisconnectCommand

Source§

impl DockerCommand for NetworkInspectCommand

Source§

impl DockerCommand for NetworkLsCommand

Source§

impl DockerCommand for NetworkPruneCommand

Source§

impl DockerCommand for NetworkRmCommand

Source§

impl DockerCommand for PauseCommand

Source§

impl DockerCommand for PortCommand

Source§

impl DockerCommand for PsCommand

Source§

impl DockerCommand for PullCommand

Source§

impl DockerCommand for PushCommand

Source§

impl DockerCommand for RenameCommand

Source§

impl DockerCommand for RestartCommand

Source§

impl DockerCommand for RmCommand

Source§

impl DockerCommand for RmiCommand

Source§

impl DockerCommand for RunCommand

Source§

impl DockerCommand for SaveCommand

Source§

impl DockerCommand for SearchCommand

Source§

impl DockerCommand for StartCommand

Source§

impl DockerCommand for StatsCommand

Source§

impl DockerCommand for StopCommand

Source§

impl DockerCommand for SystemDfCommand

Source§

impl DockerCommand for SystemPruneCommand

Source§

impl DockerCommand for TagCommand

Source§

impl DockerCommand for TopCommand

Source§

impl DockerCommand for UnpauseCommand

Source§

impl DockerCommand for UpdateCommand

Source§

impl DockerCommand for VersionCommand

Source§

impl DockerCommand for VolumeCreateCommand

Source§

impl DockerCommand for VolumeInspectCommand

Source§

impl DockerCommand for VolumeLsCommand

Source§

impl DockerCommand for VolumePruneCommand

Source§

impl DockerCommand for VolumeRmCommand

Source§

impl DockerCommand for WaitCommand