Struct rustables::expr::Nat

source ·
pub struct Nat {
    pub nat_type: Option<NatType>,
    pub family: Option<ProtocolFamily>,
    pub ip_register: Option<Register>,
    pub port_register: Option<Register>,
}
Expand description

A source or destination NAT statement. Modifies the source or destination address (and possibly port) of packets.

Fields§

§nat_type: Option<NatType>§family: Option<ProtocolFamily>§ip_register: Option<Register>§port_register: Option<Register>

Implementations§

source§

impl Nat

source

pub fn get_nat_type(&self) -> Option<&NatType>

source

pub fn get_mut_nat_type(&mut self) -> Option<&mut NatType>

source

pub fn set_nat_type(&mut self, val: impl Into<NatType>)

source

pub fn with_nat_type(self, val: impl Into<NatType>) -> Self

source§

impl Nat

source

pub fn get_family(&self) -> Option<&ProtocolFamily>

source

pub fn get_mut_family(&mut self) -> Option<&mut ProtocolFamily>

source

pub fn set_family(&mut self, val: impl Into<ProtocolFamily>)

source

pub fn with_family(self, val: impl Into<ProtocolFamily>) -> Self

source§

impl Nat

source

pub fn get_ip_register(&self) -> Option<&Register>

source

pub fn get_mut_ip_register(&mut self) -> Option<&mut Register>

source

pub fn set_ip_register(&mut self, val: impl Into<Register>)

source

pub fn with_ip_register(self, val: impl Into<Register>) -> Self

source§

impl Nat

source

pub fn get_port_register(&self) -> Option<&Register>

source

pub fn get_mut_port_register(&mut self) -> Option<&mut Register>

source

pub fn set_port_register(&mut self, val: impl Into<Register>)

source

pub fn with_port_register(self, val: impl Into<Register>) -> Self

Trait Implementations§

source§

impl Clone for Nat

source§

fn clone(&self) -> Nat

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Nat

source§

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

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

impl Default for Nat

source§

fn default() -> Nat

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

impl Expression for Nat

source§

fn get_name() -> &'static str

source§

impl From<Nat> for ExpressionVariant

source§

fn from(val: Nat) -> Self

Converts to this type from the input type.
source§

impl PartialEq<Nat> for Nat

source§

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

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

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

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

impl Eq for Nat

source§

impl StructuralEq for Nat

source§

impl StructuralPartialEq for Nat

Auto Trait Implementations§

§

impl RefUnwindSafe for Nat

§

impl Send for Nat

§

impl Sync for Nat

§

impl Unpin for Nat

§

impl UnwindSafe for Nat

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

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

const: unstable · 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> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.