Struct nmstate::RouteRuleEntry
source · #[non_exhaustive]pub struct RouteRuleEntry {
pub family: Option<AddressFamily>,
pub state: Option<RouteRuleState>,
pub ip_from: Option<String>,
pub ip_to: Option<String>,
pub priority: Option<i64>,
pub table_id: Option<u32>,
pub fwmark: Option<u32>,
pub fwmask: Option<u32>,
pub action: Option<RouteRuleAction>,
pub iif: Option<String>,
}
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.family: Option<AddressFamily>
Indicate the address family of the route rule.
state: Option<RouteRuleState>
Indicate this is normal route rule or absent route rule.
ip_from: Option<String>
Source prefix to match.
Serialize and deserialize to/from ip-from
.
ip_to: Option<String>
Destination prefix to match.
Serialize and deserialize to/from ip-to
.
priority: Option<i64>
Priority of this route rule. Bigger number means lower priority.
table_id: Option<u32>
The routing table ID to lookup if the rule selector matches.
Serialize and deserialize to/from route-table
.
fwmark: Option<u32>
Select the fwmark value to match
fwmask: Option<u32>
Select the fwmask value to match
action: Option<RouteRuleAction>
Actions for matching packages.
iif: Option<String>
Incoming interface.
Implementations§
source§impl RouteRuleEntry
impl RouteRuleEntry
sourcepub const USE_DEFAULT_PRIORITY: i64 = -1i64
pub const USE_DEFAULT_PRIORITY: i64 = -1i64
Let network backend choose the default priority.
sourcepub const USE_DEFAULT_ROUTE_TABLE: u32 = 0u32
pub const USE_DEFAULT_ROUTE_TABLE: u32 = 0u32
Use main route table 254.
sourcepub const DEFAULR_ROUTE_TABLE_ID: u32 = 254u32
pub const DEFAULR_ROUTE_TABLE_ID: u32 = 254u32
Default route table main(254).
pub fn new() -> Self
Trait Implementations§
source§impl Clone for RouteRuleEntry
impl Clone for RouteRuleEntry
source§fn clone(&self) -> RouteRuleEntry
fn clone(&self) -> RouteRuleEntry
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for RouteRuleEntry
impl Debug for RouteRuleEntry
source§impl Default for RouteRuleEntry
impl Default for RouteRuleEntry
source§fn default() -> RouteRuleEntry
fn default() -> RouteRuleEntry
Returns the “default value” for a type. Read more
source§impl<'de> Deserialize<'de> for RouteRuleEntry
impl<'de> Deserialize<'de> for RouteRuleEntry
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Ord for RouteRuleEntry
impl Ord for RouteRuleEntry
source§impl PartialEq<RouteRuleEntry> for RouteRuleEntry
impl PartialEq<RouteRuleEntry> for RouteRuleEntry
source§impl PartialOrd<RouteRuleEntry> for RouteRuleEntry
impl PartialOrd<RouteRuleEntry> for RouteRuleEntry
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for RouteRuleEntry
impl Serialize for RouteRuleEntry
impl Eq for RouteRuleEntry
Auto Trait Implementations§
impl RefUnwindSafe for RouteRuleEntry
impl Send for RouteRuleEntry
impl Sync for RouteRuleEntry
impl Unpin for RouteRuleEntry
impl UnwindSafe for RouteRuleEntry
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
source§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.