podman_client/models/podman/pods/
stats.rs

1use core::fmt;
2
3use serde::{Deserialize, Serialize};
4
5#[derive(Default)]
6pub struct PodStatsOptions<'a> {
7    pub all: Option<bool>,
8    pub names_or_ids: Option<Vec<&'a str>>,
9}
10
11pub type PodStats = Vec<PodStatsItem>;
12
13#[derive(Deserialize, Serialize)]
14#[serde(rename_all = "PascalCase")]
15pub struct PodStatsItem {
16    #[serde(rename = "BlockIO")]
17    pub block_io: String,
18    #[serde(rename = "CID")]
19    pub cid: String,
20    #[serde(rename = "CPU")]
21    pub cpu: String,
22    pub mem: String,
23    pub mem_usage: String,
24    pub mem_usage_bytes: String,
25    pub name: String,
26    #[serde(rename = "NetIO")]
27    pub net_io: String,
28    #[serde(rename = "PIDS")]
29    pub pids: String,
30    pub pod: String,
31}
32
33impl fmt::Debug for PodStatsItem {
34    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
35        let json = serde_json::to_string_pretty(self).map_err(|_| fmt::Error)?;
36        f.write_str(&json)
37    }
38}