pub struct Rule<'a> { /* private fields */ }Expand description
A nftables firewall rule.
Implementations§
Source§impl<'a> Rule<'a>
impl<'a> Rule<'a>
Sourcepub fn set_position(&mut self, position: u64)
pub fn set_position(&mut self, position: u64)
Sets the position of this rule within the chain it lives in. By default a new rule is added to the end of the chain.
pub fn set_handle(&mut self, handle: u64)
Sourcepub fn add_expr(&mut self, expr: &impl Expression)
pub fn add_expr(&mut self, expr: &impl Expression)
Adds an expression to this rule. Expressions are evaluated from first to last added. As soon as an expression does not match the packet it’s being evaluated for, evaluation stops and the packet is evaluated against the next rule in the chain.
Trait Implementations§
impl Send for Rule<'_>
impl Sync for Rule<'_>
Auto Trait Implementations§
impl<'a> Freeze for Rule<'a>
impl<'a> RefUnwindSafe for Rule<'a>
impl<'a> Unpin for Rule<'a>
impl<'a> UnsafeUnpin for Rule<'a>
impl<'a> UnwindSafe for Rule<'a>
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