pub struct ImagePruneCommand {
pub executor: CommandExecutor,
/* private fields */
}
Expand description
Docker image prune command
Remove unused images
Fields§
§executor: CommandExecutor
Command executor
Implementations§
Source§impl ImagePruneCommand
impl ImagePruneCommand
Sourcepub fn dangling_only(self) -> Self
pub fn dangling_only(self) -> Self
Only remove dangling images (default behavior)
Sourcepub fn filter(self, key: &str, value: &str) -> Self
pub fn filter(self, key: &str, value: &str) -> Self
Add a filter (e.g., “until=24h”, “label=foo=bar”)
Sourcepub fn with_label(self, key: &str, value: Option<&str>) -> Self
pub fn with_label(self, key: &str, value: Option<&str>) -> Self
Prune images with the specified label
Sourcepub async fn run(&self) -> Result<ImagePruneResult>
pub async fn run(&self) -> Result<ImagePruneResult>
Execute the image prune command
§Errors
Returns an error if the command fails to execute or if Docker is not available.
Trait Implementations§
Source§impl Clone for ImagePruneCommand
impl Clone for ImagePruneCommand
Source§fn clone(&self) -> ImagePruneCommand
fn clone(&self) -> ImagePruneCommand
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 ImagePruneCommand
impl Debug for ImagePruneCommand
Source§impl Default for ImagePruneCommand
impl Default for ImagePruneCommand
Source§impl DockerCommand for ImagePruneCommand
impl DockerCommand for ImagePruneCommand
Source§type Output = ImagePruneResult
type Output = ImagePruneResult
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 ImagePruneCommand
impl RefUnwindSafe for ImagePruneCommand
impl Send for ImagePruneCommand
impl Sync for ImagePruneCommand
impl Unpin for ImagePruneCommand
impl UnwindSafe for ImagePruneCommand
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