use std::fmt;
use boxferry_engine::PlatformVersion;
#[derive(Clone, Eq, PartialEq)]
pub struct PodmanOutput {
target_version: PlatformVersion,
deployment_json: String,
commands_shell: String,
}
impl PodmanOutput {
pub(crate) const fn new(target_version: PlatformVersion, deployment_json: String, commands_shell: String) -> Self {
Self {
target_version,
deployment_json,
commands_shell,
}
}
#[must_use]
pub const fn target_version(&self) -> PlatformVersion {
self.target_version
}
#[must_use]
pub fn deployment_json(&self) -> &str {
&self.deployment_json
}
#[must_use]
pub fn commands_shell(&self) -> &str {
&self.commands_shell
}
}
impl fmt::Debug for PodmanOutput {
fn fmt(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
formatter
.debug_struct("PodmanOutput")
.field("target_version", &self.target_version)
.field("deployment_json", &"[REDACTED]")
.field("deployment_json_bytes", &self.deployment_json.len())
.field("commands_shell", &"[REDACTED]")
.field("commands_shell_bytes", &self.commands_shell.len())
.finish()
}
}