Struct rustables::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() -> Chain

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

impl PartialEq for Chain

source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for Chain

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 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>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.