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,
) -> PortMapping
pub fn new( host_ip: Option<String>, host_port: Option<PortNumber>, container_port: PortNumber, protocol: PortProtocol, ) -> PortMapping
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§type Err = PortMappingError
type Err = PortMappingError
The associated error which can be returned from parsing.
Source§fn from_str(value: &str) -> Result<PortMapping, <PortMapping as FromStr>::Err>
fn from_str(value: &str) -> Result<PortMapping, <PortMapping as FromStr>::Err>
Parses a string
s to return a value of this type. Read moreSource§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
Source§type Error = PortMappingError
type Error = PortMappingError
The type returned in the event of a conversion error.
Source§fn try_from(
value: &str,
) -> Result<PortMapping, <PortMapping as TryFrom<&str>>::Error>
fn try_from( value: &str, ) -> Result<PortMapping, <PortMapping as TryFrom<&str>>::Error>
Performs the conversion.
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