PfIocTable

Struct PfIocTable 

Source
pub struct PfIocTable {
    pub table: PfrTable,
    pub buffer: Vec<PfrAddr>,
    /* private fields */
}
Expand description

A Rust-friendly wrapper to #[repr(C)] struct pfioc_table

Fields§

§table: PfrTable§buffer: Vec<PfrAddr>

Implementations§

Source§

impl PfIocTable

Source

pub fn new(name: &str) -> PfIocTable

Constructs a PfIocTable with a given name

Source

pub fn default() -> PfIocTable

Constructs a PfIocTable with empty values

Source

pub fn fire(&mut self, fd: &File, cmd: PfIocCommand) -> Result<(), PfError>

Makes an ioctl system call on fd operating on this struct

Source

pub fn size(&self) -> usize

Getter method for internal value size, set by the kernel

Source

pub fn added(&self) -> u32

Getter method for internal value added, set by the kernel

Source

pub fn deleted(&self) -> u32

Getter method for internal value deleted, set by the kernel

Trait Implementations§

Source§

impl Debug for PfIocTable

Source§

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

Skips non-Debug field self.pfrio_buffer

Source§

impl PartialEq for PfIocTable

Source§

fn eq(&self, other: &Self) -> 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 Translate<pfioc_table> for PfIocTable

Source§

fn translate(&self) -> Result<pfioc_table, PfError>

Will fail if buffer or table fail to translate

Source§

fn update(&mut self, io: pfioc_table) -> Result<(), PfError>

Will fail if buffer or table fail to update

Auto Trait Implementations§

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

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.