pub struct ExposePort {
pub host_port: u16,
pub container_port: Option<u16>,
pub family: String,
}Expand description
Struct to hold a port definition to expose on the host/between containers.
Fields§
§host_port: u16Port the container_port should be exposed to on the host.
container_port: Option<u16>Port the host_port should map to into the container.
family: StringFamily of the exposed port.
Can be left blank, tcp will be used as default.
Trait Implementations§
Source§impl Clone for ExposePort
impl Clone for ExposePort
Source§fn clone(&self) -> ExposePort
fn clone(&self) -> ExposePort
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 ExposePort
impl Debug for ExposePort
Source§impl Default for ExposePort
impl Default for ExposePort
Source§fn default() -> ExposePort
fn default() -> ExposePort
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ExposePort
impl<'de> Deserialize<'de> for ExposePort
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
impl Eq for ExposePort
Source§impl FromStr for ExposePort
impl FromStr for ExposePort
Source§fn from_str(s: &str) -> Result<Self, Self::Err>
fn from_str(s: &str) -> Result<Self, Self::Err>
Convert a formatted string into a ExposePort.
The string has to be in the format <HOST_PORT>[:<CONTAINER_PORT>]/<FAMILY>, i.e.
80:8080/tcp. If you don’t specify the container-port, it is assumed to be identical to the
host-port.
§Example
let port: ExposePort = "80".parse().unwrap();
assert_eq!(port.host_port, 80);
assert_eq!(port.container_port, None);
assert_eq!(port.family, "tcp");let port: ExposePort = "53/udp".parse().unwrap();
assert_eq!(port.host_port, 53);
assert_eq!(port.container_port, None);
assert_eq!(port.family, "udp");let port: ExposePort = "80:8080/tcp".parse().unwrap();
assert_eq!(port.host_port, 80);
assert_eq!(port.container_port, Some(8080));
assert_eq!(port.family, "tcp");Source§impl Hash for ExposePort
impl Hash for ExposePort
Source§impl PartialEq for ExposePort
impl PartialEq for ExposePort
impl StructuralPartialEq for ExposePort
Auto Trait Implementations§
impl Freeze for ExposePort
impl RefUnwindSafe for ExposePort
impl Send for ExposePort
impl Sync for ExposePort
impl Unpin for ExposePort
impl UnsafeUnpin for ExposePort
impl UnwindSafe for ExposePort
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.