pub struct Chain {
pub name: String,
pub hook_point: HookPoint,
pub policy: ChainPolicy,
pub rule_ids: Vec<u64>,
}Expand description
A chain of firewall rules evaluated in order
Fields§
§name: StringName of this chain (e.g., “INPUT”, “FORWARD”, “custom_chain”)
hook_point: HookPointHook point this chain is attached to
policy: ChainPolicyDefault policy when no rules match
rule_ids: Vec<u64>Rule IDs in evaluation order (lower index = higher priority)
Implementations§
Source§impl Chain
impl Chain
Sourcepub fn new(name: &str, hook_point: HookPoint, policy: ChainPolicy) -> Self
pub fn new(name: &str, hook_point: HookPoint, policy: ChainPolicy) -> Self
Create a new chain with the given name and hook point
Sourcepub fn remove_rule(&mut self, rule_id: u64) -> bool
pub fn remove_rule(&mut self, rule_id: u64) -> bool
Remove a rule ID from this chain
Sourcepub fn insert_rule(&mut self, index: usize, rule_id: u64)
pub fn insert_rule(&mut self, index: usize, rule_id: u64)
Insert a rule ID at the given position
Sourcepub fn rule_count(&self) -> usize
pub fn rule_count(&self) -> usize
Number of rules in this chain
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Chain
impl RefUnwindSafe for Chain
impl Send for Chain
impl Sync for Chain
impl Unpin for Chain
impl UnwindSafe for Chain
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)