podman_client/models/podman/common/
port_mapping.rs1use core::fmt;
2
3use serde::{Deserialize, Serialize};
4
5#[derive(Deserialize, Serialize, Default)]
6pub struct PortMapping {
7 pub container_port: u64,
8 pub host_ip: String,
9 pub host_port: u16,
10 pub protocol: String,
11 pub range: u16,
12}
13
14impl fmt::Debug for PortMapping {
15 fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
16 let json = serde_json::to_string_pretty(self).map_err(|_| fmt::Error)?;
17 f.write_str(&json)
18 }
19}