pub struct VersionCommand { /* private fields */ }
Expand description
Command for retrieving Docker version information
The VersionCommand
provides a builder pattern for constructing Docker version commands
with various output format options.
§Examples
use docker_wrapper::VersionCommand;
// Basic version info
let version = VersionCommand::new();
// JSON format output
let version = VersionCommand::new().format_json();
// Custom format
let version = VersionCommand::new()
.format("{{.Client.Version}}");
Implementations§
Source§impl VersionCommand
impl VersionCommand
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new version command
§Examples
use docker_wrapper::VersionCommand;
let version = VersionCommand::new();
Sourcepub fn format_json(self) -> Self
pub fn format_json(self) -> Self
Sets output format to JSON
§Examples
use docker_wrapper::VersionCommand;
let version = VersionCommand::new().format_json();
Sourcepub fn format_table(self) -> Self
pub fn format_table(self) -> Self
Sets output format to table (default)
Sourcepub fn executor(self, executor: CommandExecutor) -> Self
pub fn executor(self, executor: CommandExecutor) -> Self
Sourcepub fn get_format(&self) -> Option<&str>
pub fn get_format(&self) -> Option<&str>
Gets the output format (if set)
Trait Implementations§
Source§impl Clone for VersionCommand
impl Clone for VersionCommand
Source§fn clone(&self) -> VersionCommand
fn clone(&self) -> VersionCommand
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 VersionCommand
impl Debug for VersionCommand
Source§impl Default for VersionCommand
impl Default for VersionCommand
Source§impl Display for VersionCommand
impl Display for VersionCommand
Source§impl DockerCommand for VersionCommand
impl DockerCommand for VersionCommand
Source§type Output = VersionOutput
type Output = VersionOutput
The output type this command produces
Source§fn command_name(&self) -> &'static str
fn command_name(&self) -> &'static str
Get the command name (e.g., “run”, “exec”, “ps”)
Source§fn build_args(&self) -> Vec<String>
fn build_args(&self) -> Vec<String>
Build the command arguments
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 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 VersionCommand
impl RefUnwindSafe for VersionCommand
impl Send for VersionCommand
impl Sync for VersionCommand
impl Unpin for VersionCommand
impl UnwindSafe for VersionCommand
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