pub struct PortMapping { /* private fields */ }Expand description
A Docker port mapping.
Implementations§
Source§impl PortMapping
impl PortMapping
Sourcepub fn new(
host_ip: Option<String>,
host_port: Option<PortNumber>,
container_port: PortNumber,
protocol: PortProtocol,
) -> Self
pub fn new( host_ip: Option<String>, host_port: Option<PortNumber>, container_port: PortNumber, protocol: PortProtocol, ) -> Self
Creates a mapping from validated parts.
Sourcepub const fn host_port(&self) -> Option<PortNumber>
pub const fn host_port(&self) -> Option<PortNumber>
Returns the optional host port.
Sourcepub const fn container_port(&self) -> PortNumber
pub const fn container_port(&self) -> PortNumber
Returns the container port.
Sourcepub const fn protocol(&self) -> PortProtocol
pub const fn protocol(&self) -> PortProtocol
Returns the protocol.
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 (const: unstable) · 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 Display for PortMapping
impl Display for PortMapping
Source§impl FromStr for PortMapping
impl FromStr for PortMapping
Source§impl Hash for PortMapping
impl Hash for PortMapping
Source§impl Ord for PortMapping
impl Ord for PortMapping
Source§fn cmp(&self, other: &PortMapping) -> Ordering
fn cmp(&self, other: &PortMapping) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for PortMapping
impl PartialEq for PortMapping
Source§fn eq(&self, other: &PortMapping) -> bool
fn eq(&self, other: &PortMapping) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl PartialOrd for PortMapping
impl PartialOrd for PortMapping
Source§impl TryFrom<&str> for PortMapping
impl TryFrom<&str> for PortMapping
impl Eq for PortMapping
impl StructuralPartialEq for PortMapping
Auto Trait Implementations§
impl Freeze for PortMapping
impl RefUnwindSafe for PortMapping
impl Send for PortMapping
impl Sync for PortMapping
impl Unpin for PortMapping
impl UnsafeUnpin 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