pub struct Port { /* private fields */ }Expand description
One container port published to a fixed or automatically allocated host port.
An absent published port requests automatic host-port allocation. Exposure without host
publication is represented separately by ExposedPort.
Implementations§
Source§impl Port
impl Port
Sourcepub fn new(
container: u16,
published: Option<u16>,
host_address: Option<String>,
protocol: Protocol,
) -> Result<Self, ModelError>
pub fn new( container: u16, published: Option<u16>, host_address: Option<String>, protocol: Protocol, ) -> Result<Self, ModelError>
Creates a host-publication declaration; published: None requests automatic allocation.
§Errors
Returns ModelError::ZeroContainerPort when container is zero.
Sourcepub const fn published(&self) -> Option<u16>
pub const fn published(&self) -> Option<u16>
Returns the fixed host port, or None when the runtime should allocate one automatically.
Sourcepub fn host_address(&self) -> Option<&str>
pub fn host_address(&self) -> Option<&str>
Returns the optional host address spelling.
Trait Implementations§
impl Eq for Port
impl StructuralPartialEq for Port
Auto Trait Implementations§
impl Freeze for Port
impl RefUnwindSafe for Port
impl Send for Port
impl Sync for Port
impl Unpin for Port
impl UnsafeUnpin for Port
impl UnwindSafe for Port
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