pub struct ContainerDNATRule {
pub src_network: Option<String>,
pub src_container: Option<String>,
pub dst_network: String,
pub dst_container: String,
pub expose_port: Vec<ExposePort>,
}Expand description
Definition for a rule to be used in the container-DNAT section.
Fields§
§src_network: Option<String>Network of the source container to apply the rule to.
src_container: Option<String>Source container to apply the rule to. Requires src_network.
dst_network: StringNetwork of the destination container to apply the rule to.
dst_container: StringDestination container to apply the rule to.
expose_port: Vec<ExposePort>Ports to apply the rule to.
Defined as:
-
a single integer
-
a single string
-
a single struct
-
a list of integers
-
a list of strings
-
a list of structs
§Example
All of the following are legal TOML fragments:
expose_port = 80
expose_port = [80, 443]
expose_port = "53/udp"
expose_port = ["80/tcp", "53/udp"]
# The following four all result in the same definition
expose_port = { host_port = 8080 }
expose_port = { host_port = 8080, container_port = 8080 }
expose_port = { host_port = 8080, family = "tcp" }
expose_port = { host_port = 8080, container_port = 8080, family = "tcp" }
expose_port = [
{ host_port = 80 },
{ host_port = 53, family = "udp" },
{ host_port = 443, container_port = 8443 },
]Trait Implementations§
Source§impl Clone for ContainerDNATRule
impl Clone for ContainerDNATRule
Source§fn clone(&self) -> ContainerDNATRule
fn clone(&self) -> ContainerDNATRule
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 ContainerDNATRule
impl Debug for ContainerDNATRule
Source§impl<'de> Deserialize<'de> for ContainerDNATRule
impl<'de> Deserialize<'de> for ContainerDNATRule
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 ContainerDNATRule
Source§impl Hash for ContainerDNATRule
impl Hash for ContainerDNATRule
Source§impl PartialEq for ContainerDNATRule
impl PartialEq for ContainerDNATRule
Source§impl Process<Iptables> for ContainerDNATRule
impl Process<Iptables> for ContainerDNATRule
Source§fn process(
&self,
ctx: &ProcessContext<'_, Iptables>,
) -> Result<Option<Vec<IptablesRule>>>
fn process( &self, ctx: &ProcessContext<'_, Iptables>, ) -> Result<Option<Vec<IptablesRule>>>
Process the current type within the given
ProcessContext, returning zero or more rules
to apply with nft.Source§impl Process<Nftables> for ContainerDNATRule
impl Process<Nftables> for ContainerDNATRule
Source§fn process(
&self,
ctx: &ProcessContext<'_, Nftables>,
) -> Result<Option<Vec<String>>>
fn process( &self, ctx: &ProcessContext<'_, Nftables>, ) -> Result<Option<Vec<String>>>
Process the current type within the given
ProcessContext, returning zero or more rules
to apply with nft.impl StructuralPartialEq for ContainerDNATRule
Auto Trait Implementations§
impl Freeze for ContainerDNATRule
impl RefUnwindSafe for ContainerDNATRule
impl Send for ContainerDNATRule
impl Sync for ContainerDNATRule
impl Unpin for ContainerDNATRule
impl UnsafeUnpin for ContainerDNATRule
impl UnwindSafe for ContainerDNATRule
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.