pub struct PortMapping {
pub container_port: u16,
pub host_port: u16,
pub protocol: String,
}Expand description
Port mapping configuration
Fields§
§container_port: u16Container port
host_port: u16Host port
protocol: StringProtocol (tcp/udp)
Implementations§
Source§impl PortMapping
impl PortMapping
Sourcepub fn get_host_addr(&self) -> SocketAddr
pub fn get_host_addr(&self) -> SocketAddr
Get socket address for host
Sourcepub fn get_container_addr(&self, ip: Ipv4Addr) -> SocketAddr
pub fn get_container_addr(&self, ip: Ipv4Addr) -> SocketAddr
Get socket address for container
Trait Implementations§
Source§impl Clone for PortMapping
impl Clone for PortMapping
Source§fn clone(&self) -> PortMapping
fn clone(&self) -> PortMapping
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PortMapping
impl Debug for PortMapping
Source§impl<'de> Deserialize<'de> for PortMapping
impl<'de> Deserialize<'de> for PortMapping
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for PortMapping
impl RefUnwindSafe for PortMapping
impl Send for PortMapping
impl Sync for PortMapping
impl Unpin for PortMapping
impl UnwindSafe for PortMapping
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more