pub trait DockerCommand {
type Output;
// Required methods
fn command_name(&self) -> &'static str;
fn build_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;
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
Base trait for all Docker commands
Required Associated Types§
Required Methods§
Sourcefn command_name(&self) -> &'static str
fn command_name(&self) -> &'static str
Get the command name (e.g., “run”, “exec”, “ps”)
Sourcefn build_args(&self) -> Vec<String>
fn build_args(&self) -> Vec<String>
Build the command arguments
Sourcefn 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
Sourcefn 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)
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.