pub struct DiffCommand {
pub executor: CommandExecutor,
/* private fields */
}
Expand description
Docker diff command builder
Inspect changes to files or folders on a container’s filesystem.
§Example
use docker_wrapper::DiffCommand;
// Show filesystem changes
let changes = DiffCommand::new("my-container")
.run()
.await?;
for change in changes.filesystem_changes() {
println!("{}: {}", change.change_type, change.path);
}
Fields§
§executor: CommandExecutor
Command executor
Implementations§
Source§impl DiffCommand
impl DiffCommand
Sourcepub fn new(container: impl Into<String>) -> Self
pub fn new(container: impl Into<String>) -> Self
Create a new diff command
§Example
use docker_wrapper::DiffCommand;
let cmd = DiffCommand::new("my-container");
Sourcepub async fn run(&self) -> Result<DiffResult>
pub async fn run(&self) -> Result<DiffResult>
Execute the diff command
§Errors
Returns an error if:
- The Docker daemon is not running
- The container doesn’t exist
§Example
use docker_wrapper::DiffCommand;
let result = DiffCommand::new("my-container")
.run()
.await?;
if result.success() {
println!("Filesystem changes:");
for change in result.filesystem_changes() {
println!("{}: {}", change.change_type, change.path);
}
}
Trait Implementations§
Source§impl Clone for DiffCommand
impl Clone for DiffCommand
Source§fn clone(&self) -> DiffCommand
fn clone(&self) -> DiffCommand
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 DiffCommand
impl Debug for DiffCommand
Source§impl DockerCommand for DiffCommand
impl DockerCommand for DiffCommand
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 DiffCommand
impl RefUnwindSafe for DiffCommand
impl Send for DiffCommand
impl Sync for DiffCommand
impl Unpin for DiffCommand
impl UnwindSafe for DiffCommand
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