podman_client/models/podman/artifacts/
inspect.rs

1use core::fmt;
2use std::collections::HashMap;
3
4use serde::{Deserialize, Serialize};
5
6use crate::models::podman::common::manifest_platform::ManifestPlatform;
7
8pub struct ArtifactInspectOptions<'a> {
9    pub name: &'a str,
10}
11
12#[derive(Deserialize, Serialize)]
13#[serde(rename_all = "PascalCase")]
14pub struct ArtifactInspect {
15    pub digest: String,
16    pub manifest: ArtifactInspectManifest,
17    pub name: String,
18}
19
20impl fmt::Debug for ArtifactInspect {
21    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
22        let json = serde_json::to_string_pretty(self).map_err(|_| fmt::Error)?;
23        f.write_str(&json)
24    }
25}
26
27#[derive(Deserialize, Serialize)]
28#[serde(rename_all = "camelCase")]
29pub struct ArtifactInspectManifest {
30    pub annotations: HashMap<String, String>,
31    pub artifact_type: String,
32    pub config: ArtifactInspectManifestDescriptor,
33    pub layers: Vec<ArtifactInspectManifestDescriptor>,
34    pub media_type: String,
35    pub schema_version: i64,
36    pub subject: ArtifactInspectManifestDescriptor,
37}
38
39#[derive(Deserialize, Serialize)]
40#[serde(rename_all = "camelCase")]
41pub struct ArtifactInspectManifestDescriptor {
42    pub annotations: HashMap<String, String>,
43    pub artifact_type: String,
44    pub data: Vec<u8>,
45    pub digest: String,
46    pub media_type: String,
47    pub platform: ManifestPlatform,
48    pub size: i64,
49    pub urls: Vec<String>,
50}