boxferry_podman/
output.rs1use std::fmt;
4
5use boxferry_engine::PlatformVersion;
6
7#[derive(Clone, Eq, PartialEq)]
9pub struct PodmanOutput {
10 target_version: PlatformVersion,
11 deployment_json: String,
12 commands_shell: String,
13}
14
15impl PodmanOutput {
16 pub(crate) const fn new(target_version: PlatformVersion, deployment_json: String, commands_shell: String) -> Self {
17 Self {
18 target_version,
19 deployment_json,
20 commands_shell,
21 }
22 }
23
24 #[must_use]
26 pub const fn target_version(&self) -> PlatformVersion {
27 self.target_version
28 }
29
30 #[must_use]
34 pub fn deployment_json(&self) -> &str {
35 &self.deployment_json
36 }
37
38 #[must_use]
43 pub fn commands_shell(&self) -> &str {
44 &self.commands_shell
45 }
46}
47
48impl fmt::Debug for PodmanOutput {
49 fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
50 formatter
51 .debug_struct("PodmanOutput")
52 .field("target_version", &self.target_version)
53 .field("deployment_json", &"[REDACTED]")
54 .field("deployment_json_bytes", &self.deployment_json.len())
55 .field("commands_shell", &"[REDACTED]")
56 .field("commands_shell_bytes", &self.commands_shell.len())
57 .finish()
58 }
59}