podman_client/models/podman/images/
prune.rs

1use core::fmt;
2
3use serde::{Deserialize, Serialize};
4
5#[derive(Default)]
6pub struct ImagePruneOptions<'a> {
7    pub all: Option<bool>,
8    pub build_cache: Option<bool>,
9    pub external: Option<bool>,
10    pub filters: Option<ImagePruneFiltersOptions<'a>>,
11}
12
13#[derive(Default)]
14pub struct ImagePruneFiltersOptions<'a> {
15    pub dangling: Option<Vec<bool>>,
16    pub until: Option<Vec<&'a str>>,
17    pub label: Option<Vec<&'a str>>,
18    pub labelnot: Option<Vec<&'a str>>,
19}
20
21pub type ImagePrune = Vec<ImagePruneItem>;
22
23#[derive(Deserialize, Serialize)]
24#[serde(rename_all = "PascalCase")]
25pub struct ImagePruneItem {
26    pub err: String,
27    pub id: String,
28    pub size: u64,
29}
30
31impl fmt::Debug for ImagePruneItem {
32    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
33        let json = serde_json::to_string_pretty(self).map_err(|_| fmt::Error)?;
34        f.write_str(&json)
35    }
36}