pub struct PortBinding {
pub container_port: u16,
pub host_address: Option<String>,
pub host_port: u16,
}Expand description
Host-to-container port binding resolved from the manifest.
Corresponds to the -p / --publish Docker flag. The manifest
supports three forms:
| Manifest form | Result |
|---|---|
8080 (short) | container_port = 8080, host_port = 8080, no address |
"8080:80" | host_port = 8080, container_port = 80 |
"127.0.0.1:8080:80" | as above plus host_address = Some("127.0.0.1") |
§Example
use lightshuttle_spec::PortBinding;
let binding = PortBinding {
container_port: 80,
host_address: Some("127.0.0.1".into()),
host_port: 8080,
};
assert_eq!(binding.host_port, 8080);Fields§
§container_port: u16Port exposed by the container.
host_address: Option<String>Optional host interface to bind to. When None the runtime
binds to all interfaces (0.0.0.0).
host_port: u16Port published on the host. Mirrors container_port when the
short integer form is used in the manifest.
Trait Implementations§
Source§impl Clone for PortBinding
impl Clone for PortBinding
Source§fn clone(&self) -> PortBinding
fn clone(&self) -> PortBinding
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 PortBinding
impl Debug for PortBinding
impl Eq for PortBinding
Source§impl PartialEq for PortBinding
impl PartialEq for PortBinding
impl StructuralPartialEq for PortBinding
Auto Trait Implementations§
impl Freeze for PortBinding
impl RefUnwindSafe for PortBinding
impl Send for PortBinding
impl Sync for PortBinding
impl Unpin for PortBinding
impl UnsafeUnpin for PortBinding
impl UnwindSafe for PortBinding
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request