pub struct LoadCommand {
pub executor: CommandExecutor,
/* private fields */
}
Expand description
Docker load command builder
Load an image from a tar archive or STDIN.
§Example
use docker_wrapper::LoadCommand;
use std::path::Path;
// Load image from file
let result = LoadCommand::new()
.input(Path::new("alpine.tar"))
.run()
.await?;
println!("Loaded images: {:?}", result.loaded_images());
Fields§
§executor: CommandExecutor
Command executor
Implementations§
Source§impl LoadCommand
impl LoadCommand
Sourcepub fn input(self, path: &Path) -> Self
pub fn input(self, path: &Path) -> Self
Set input file path
§Example
use docker_wrapper::LoadCommand;
use std::path::Path;
let cmd = LoadCommand::new()
.input(Path::new("images.tar"));
Sourcepub fn quiet(self) -> Self
pub fn quiet(self) -> Self
Suppress progress output during load
§Example
use docker_wrapper::LoadCommand;
let cmd = LoadCommand::new().quiet();
Sourcepub async fn run(&self) -> Result<LoadResult>
pub async fn run(&self) -> Result<LoadResult>
Execute the load command
§Errors
Returns an error if:
- The Docker daemon is not running
- The input file doesn’t exist or is not readable
- The tar archive is corrupted or invalid
§Example
use docker_wrapper::LoadCommand;
use std::path::Path;
let result = LoadCommand::new()
.input(Path::new("alpine.tar"))
.run()
.await?;
if result.success() {
println!("Images loaded successfully");
for image in result.loaded_images() {
println!(" - {}", image);
}
}
Trait Implementations§
Source§impl Clone for LoadCommand
impl Clone for LoadCommand
Source§fn clone(&self) -> LoadCommand
fn clone(&self) -> LoadCommand
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 LoadCommand
impl Debug for LoadCommand
Source§impl Default for LoadCommand
impl Default for LoadCommand
Source§impl DockerCommand for LoadCommand
impl DockerCommand for LoadCommand
Source§type Output = CommandOutput
type Output = CommandOutput
The output type this command produces
Source§fn build_command_args(&self) -> Vec<String>
fn build_command_args(&self) -> Vec<String>
Build the complete command arguments including subcommands
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 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 LoadCommand
impl RefUnwindSafe for LoadCommand
impl Send for LoadCommand
impl Sync for LoadCommand
impl Unpin for LoadCommand
impl UnwindSafe for LoadCommand
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