podman-client 0.0.2

A native Rust client for the Podman REST API over Unix sockets
Documentation
use core::fmt;

use serde::{Deserialize, Serialize};

#[derive(Deserialize, Serialize, Default)]
pub struct PortMapping {
    pub container_port: u64,
    pub host_ip: String,
    pub host_port: u16,
    pub protocol: String,
    pub range: u16,
}

impl fmt::Debug for PortMapping {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        let json = serde_json::to_string_pretty(self).map_err(|_| fmt::Error)?;
        f.write_str(&json)
    }
}