pub struct InfoCommand {
pub executor: CommandExecutor,
/* private fields */
}
Expand description
Command for retrieving Docker system information
The InfoCommand
provides a builder pattern for constructing Docker info commands
with various output format options.
§Examples
use docker_wrapper::InfoCommand;
// Basic system info
let info = InfoCommand::new();
// JSON format output
let info = InfoCommand::new().format_json();
// Custom format
let info = InfoCommand::new()
.format("{{.ServerVersion}}");
Fields§
§executor: CommandExecutor
Command executor for running the command
Implementations§
Source§impl InfoCommand
impl InfoCommand
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new info command
§Examples
use docker_wrapper::InfoCommand;
let info = InfoCommand::new();
Sourcepub fn format_json(self) -> Self
pub fn format_json(self) -> Self
Sets output format to JSON
§Examples
use docker_wrapper::InfoCommand;
let info = InfoCommand::new().format_json();
Sourcepub fn format_table(self) -> Self
pub fn format_table(self) -> Self
Sets output format to table (default)
Sourcepub fn get_executor(&self) -> &CommandExecutor
pub fn get_executor(&self) -> &CommandExecutor
Gets the command executor
Sourcepub fn get_executor_mut(&mut self) -> &mut CommandExecutor
pub fn get_executor_mut(&mut self) -> &mut CommandExecutor
Gets the command executor mutably
Sourcepub fn build_command_args(&self) -> Vec<String>
pub fn build_command_args(&self) -> Vec<String>
Builds the command arguments for Docker info
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 InfoCommand
impl Clone for InfoCommand
Source§fn clone(&self) -> InfoCommand
fn clone(&self) -> InfoCommand
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 InfoCommand
impl Debug for InfoCommand
Source§impl Default for InfoCommand
impl Default for InfoCommand
Source§impl Display for InfoCommand
impl Display for InfoCommand
Source§impl DockerCommand for InfoCommand
impl DockerCommand for InfoCommand
Source§type Output = InfoOutput
type Output = InfoOutput
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 InfoCommand
impl RefUnwindSafe for InfoCommand
impl Send for InfoCommand
impl Sync for InfoCommand
impl Unpin for InfoCommand
impl UnwindSafe for InfoCommand
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string
, but without panic on OOM.