[−][src]Trait dfw::process::Process
This trait allows a type to define its own processing rules. It is expected to return a list of rules that can be applied with nft.
Example
struct MyBackend; impl FirewallBackend for MyBackend { type Rule = String; fn apply(rules: Vec<String>, ctx: &ProcessContext<Self>) -> Result<(), Error> { // Write code to apply the processed rules. } } struct MyType { rules: Vec<String>, } impl Process<MyBackend> for MyType { fn process(&self, ctx: &ProcessContext<MyBackend>) -> Result<Option<Vec<String>>, Error> { let mut rules = Vec::new(); for rule in &self.rules { rules.push(format!("add rule {}", rule)); } Ok(Some(rules)) } }
Required methods
fn process(&self, ctx: &ProcessContext<'_, B>) -> Result<Option<Vec<B::Rule>>>
Process the current type within the given ProcessContext
, returning zero or more rules
to apply with nft.
Implementations on Foreign Types
impl<B, T> Process<B> for Option<T> where
B: FirewallBackend,
DFW<B>: Process<B>,
T: Process<B>,
[src]
B: FirewallBackend,
DFW<B>: Process<B>,
T: Process<B>,
impl<B, T> Process<B> for Vec<T> where
B: FirewallBackend,
DFW<B>: Process<B>,
T: Process<B>,
[src]
Loading content...B: FirewallBackend,
DFW<B>: Process<B>,
T: Process<B>,
Implementors
impl Process<Iptables> for <Iptables as FirewallBackend>::Defaults
[src]
fn process(
&self,
ctx: &ProcessContext<'_, Iptables>
) -> Result<Option<Vec<IptablesRule>>>
[src]
&self,
ctx: &ProcessContext<'_, Iptables>
) -> Result<Option<Vec<IptablesRule>>>
impl Process<Iptables> for ContainerDNAT
[src]
fn process(
&self,
ctx: &ProcessContext<'_, Iptables>
) -> Result<Option<Vec<IptablesRule>>>
[src]
&self,
ctx: &ProcessContext<'_, Iptables>
) -> Result<Option<Vec<IptablesRule>>>
impl Process<Iptables> for ContainerDNATRule
[src]
fn process(
&self,
ctx: &ProcessContext<'_, Iptables>
) -> Result<Option<Vec<IptablesRule>>>
[src]
&self,
ctx: &ProcessContext<'_, Iptables>
) -> Result<Option<Vec<IptablesRule>>>
impl Process<Iptables> for ContainerToContainer
[src]
fn process(
&self,
ctx: &ProcessContext<'_, Iptables>
) -> Result<Option<Vec<IptablesRule>>>
[src]
&self,
ctx: &ProcessContext<'_, Iptables>
) -> Result<Option<Vec<IptablesRule>>>
impl Process<Iptables> for ContainerToContainerRule
[src]
fn process(
&self,
ctx: &ProcessContext<'_, Iptables>
) -> Result<Option<Vec<IptablesRule>>>
[src]
&self,
ctx: &ProcessContext<'_, Iptables>
) -> Result<Option<Vec<IptablesRule>>>
impl Process<Iptables> for ContainerToHost
[src]
fn process(
&self,
ctx: &ProcessContext<'_, Iptables>
) -> Result<Option<Vec<IptablesRule>>>
[src]
&self,
ctx: &ProcessContext<'_, Iptables>
) -> Result<Option<Vec<IptablesRule>>>
impl Process<Iptables> for ContainerToHostRule
[src]
fn process(
&self,
ctx: &ProcessContext<'_, Iptables>
) -> Result<Option<Vec<IptablesRule>>>
[src]
&self,
ctx: &ProcessContext<'_, Iptables>
) -> Result<Option<Vec<IptablesRule>>>
impl Process<Iptables> for ContainerToWiderWorld
[src]
fn process(
&self,
ctx: &ProcessContext<'_, Iptables>
) -> Result<Option<Vec<IptablesRule>>>
[src]
&self,
ctx: &ProcessContext<'_, Iptables>
) -> Result<Option<Vec<IptablesRule>>>
impl Process<Iptables> for ContainerToWiderWorldRule
[src]
fn process(
&self,
ctx: &ProcessContext<'_, Iptables>
) -> Result<Option<Vec<IptablesRule>>>
[src]
&self,
ctx: &ProcessContext<'_, Iptables>
) -> Result<Option<Vec<IptablesRule>>>
impl Process<Iptables> for DFW<Iptables>
[src]
fn process(
&self,
ctx: &ProcessContext<'_, Iptables>
) -> Result<Option<Vec<IptablesRule>>>
[src]
&self,
ctx: &ProcessContext<'_, Iptables>
) -> Result<Option<Vec<IptablesRule>>>
impl Process<Iptables> for GlobalDefaults
[src]
fn process(
&self,
ctx: &ProcessContext<'_, Iptables>
) -> Result<Option<Vec<IptablesRule>>>
[src]
&self,
ctx: &ProcessContext<'_, Iptables>
) -> Result<Option<Vec<IptablesRule>>>
impl Process<Iptables> for WiderWorldToContainer
[src]
fn process(
&self,
ctx: &ProcessContext<'_, Iptables>
) -> Result<Option<Vec<IptablesRule>>>
[src]
&self,
ctx: &ProcessContext<'_, Iptables>
) -> Result<Option<Vec<IptablesRule>>>
impl Process<Iptables> for WiderWorldToContainerRule
[src]
fn process(
&self,
ctx: &ProcessContext<'_, Iptables>
) -> Result<Option<Vec<IptablesRule>>>
[src]
&self,
ctx: &ProcessContext<'_, Iptables>
) -> Result<Option<Vec<IptablesRule>>>