pub struct BuilderPruneCommand {
pub executor: CommandExecutor,
/* private fields */
}
Expand description
docker builder prune
command to remove build cache
§Example
use docker_wrapper::command::builder::BuilderPruneCommand;
use docker_wrapper::DockerCommand;
// Remove all build cache
let result = BuilderPruneCommand::new()
.all()
.force()
.execute()
.await?;
println!("Reclaimed {} bytes", result.space_reclaimed.unwrap_or(0));
Fields§
§executor: CommandExecutor
Command executor
Implementations§
Source§impl BuilderPruneCommand
impl BuilderPruneCommand
Sourcepub fn filter(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn filter(self, key: impl Into<String>, value: impl Into<String>) -> Self
Add a filter to the prune operation
Common filters:
until=<timestamp>
- only remove cache created before given timestampuntil=24h
- only remove cache older than 24 hours
Sourcepub fn keep_storage(self, size: impl Into<String>) -> Self
pub fn keep_storage(self, size: impl Into<String>) -> Self
Amount of disk storage to keep for cache
§Example
BuilderPruneCommand::new()
.keep_storage("5GB")
.execute()
.await?;
Trait Implementations§
Source§impl Clone for BuilderPruneCommand
impl Clone for BuilderPruneCommand
Source§fn clone(&self) -> BuilderPruneCommand
fn clone(&self) -> BuilderPruneCommand
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 BuilderPruneCommand
impl Debug for BuilderPruneCommand
Source§impl Default for BuilderPruneCommand
impl Default for BuilderPruneCommand
Source§impl DockerCommand for BuilderPruneCommand
impl DockerCommand for BuilderPruneCommand
Source§type Output = BuilderPruneResult
type Output = BuilderPruneResult
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 BuilderPruneCommand
impl RefUnwindSafe for BuilderPruneCommand
impl Send for BuilderPruneCommand
impl Sync for BuilderPruneCommand
impl Unpin for BuilderPruneCommand
impl UnwindSafe for BuilderPruneCommand
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