Skip to main content

Chain

Struct Chain 

Source
pub struct Chain { /* private fields */ }
Expand description

Abstraction over an nftable chain. Chains reside inside Tables and they hold Rules.

Implementations§

Source§

impl Chain

Source

pub fn get_table(&self) -> Option<&String>

Source

pub fn get_mut_table(&mut self) -> Option<&mut String>

Source

pub fn set_table(&mut self, val: impl Into<String>)

Source

pub fn with_table(self, val: impl Into<String>) -> Self

Source§

impl Chain

Source

pub fn get_name(&self) -> Option<&String>

Source

pub fn get_mut_name(&mut self) -> Option<&mut String>

Source

pub fn set_name(&mut self, val: impl Into<String>)

Source

pub fn with_name(self, val: impl Into<String>) -> Self

Source§

impl Chain

Source

pub fn get_hook(&self) -> Option<&Hook>

Source

pub fn get_mut_hook(&mut self) -> Option<&mut Hook>

Source

pub fn set_hook(&mut self, val: impl Into<Hook>)

Source

pub fn with_hook(self, val: impl Into<Hook>) -> Self

Source§

impl Chain

Source

pub fn get_policy(&self) -> Option<&ChainPolicy>

Source

pub fn get_mut_policy(&mut self) -> Option<&mut ChainPolicy>

Source

pub fn set_policy(&mut self, val: impl Into<ChainPolicy>)

Source

pub fn with_policy(self, val: impl Into<ChainPolicy>) -> Self

Source§

impl Chain

Source

pub fn get_type(&self) -> Option<&ChainType>

Source

pub fn get_mut_type(&mut self) -> Option<&mut ChainType>

Source

pub fn set_type(&mut self, val: impl Into<ChainType>)

Source

pub fn with_type(self, val: impl Into<ChainType>) -> Self

Source§

impl Chain

Source

pub fn get_flags(&self) -> Option<&u32>

Source

pub fn get_mut_flags(&mut self) -> Option<&mut u32>

Source

pub fn set_flags(&mut self, val: impl Into<u32>)

Source

pub fn with_flags(self, val: impl Into<u32>) -> Self

Source§

impl Chain

Source

pub fn get_userdata(&self) -> Option<&Vec<u8>>

Source

pub fn get_mut_userdata(&mut self) -> Option<&mut Vec<u8>>

Source

pub fn set_userdata(&mut self, val: impl Into<Vec<u8>>)

Source

pub fn with_userdata(self, val: impl Into<Vec<u8>>) -> Self

Source§

impl Chain

Source

pub fn new(table: &Table) -> Chain

Creates a new chain instance inside the given Table.

Source

pub fn add_to_batch(self, batch: &mut Batch) -> Self

Appends this chain to batch

Trait Implementations§

Source§

impl Debug for Chain

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Chain

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for Chain

Source§

impl PartialEq for Chain

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Chain

Auto Trait Implementations§

§

impl Freeze for Chain

§

impl RefUnwindSafe for Chain

§

impl Send for Chain

§

impl Sync for Chain

§

impl Unpin for Chain

§

impl UnsafeUnpin for Chain

§

impl UnwindSafe for Chain

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.