podman_client/models/podman/images/
list.rs

1use core::fmt;
2use std::collections::HashMap;
3
4use serde::{Deserialize, Serialize};
5
6#[derive(Default)]
7pub struct ImageListOptions<'a> {
8    pub all: Option<bool>,
9    pub filters: Option<ImageListFiltersOptions<'a>>,
10}
11
12#[derive(Default)]
13pub struct ImageListFiltersOptions<'a> {
14    pub before: Option<Vec<&'a str>>,
15    pub dangling: Option<Vec<bool>>,
16    pub label: Option<Vec<&'a str>>,
17    pub reference: Option<Vec<&'a str>>,
18    pub id: Option<Vec<&'a str>>,
19    pub since: Option<Vec<&'a str>>,
20}
21
22pub type ImageList = Vec<ImageListItem>;
23
24#[derive(Deserialize, Serialize)]
25#[serde(rename_all = "PascalCase")]
26pub struct ImageListItem {
27    pub arch: String,
28    pub containers: i64,
29    pub created: i64,
30    pub dangling: bool,
31    pub digest: String,
32    pub history: Vec<String>,
33    pub id: String,
34    pub is_manifest_list: bool,
35    pub labels: HashMap<String, String>,
36    pub names: Vec<String>,
37    pub os: String,
38    pub parent_id: String,
39    pub read_only: bool,
40    pub repo_digests: Vec<String>,
41    pub repo_tags: Vec<String>,
42    pub shared_size: i64,
43    pub size: i64,
44    pub virtual_size: i64,
45}
46
47impl fmt::Debug for ImageListItem {
48    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
49        let json = serde_json::to_string_pretty(self).map_err(|_| fmt::Error)?;
50        f.write_str(&json)
51    }
52}