Struct nmstate::RouteEntry
source · #[non_exhaustive]pub struct RouteEntry {
pub state: Option<RouteState>,
pub destination: Option<String>,
pub next_hop_iface: Option<String>,
pub next_hop_addr: Option<String>,
pub metric: Option<i64>,
pub table_id: Option<u32>,
pub weight: Option<u16>,
pub route_type: Option<RouteType>,
pub cwnd: Option<u32>,
pub source: Option<String>,
}
Expand description
Route entry
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.state: Option<RouteState>
Only used for delete route when applying.
destination: Option<String>
Route destination address or network Mandatory for every non-absent routes.
next_hop_iface: Option<String>
Route next hop interface name.
Serialize and deserialize to/from next-hop-interface
.
Mandatory for every non-absent routes except for route with
route type Blackhole
, Unreachable
, Prohibit
.
next_hop_addr: Option<String>
Route next hop IP address.
Serialize and deserialize to/from next-hop-address
.
When setting this as empty string for absent route, it will only delete
routes without next-hop-address
.
metric: Option<i64>
Route metric. RouteEntry::USE_DEFAULT_METRIC for default setting of network backend.
table_id: Option<u32>
Route table id. RouteEntry::USE_DEFAULT_ROUTE_TABLE for main route table 254.
weight: Option<u16>
ECMP(Equal-Cost Multi-Path) route weight The valid range of this property is 1-256.
route_type: Option<RouteType>
Route type
Serialize and deserialize to/from route-type
.
cwnd: Option<u32>
Congestion window clamp
source: Option<String>
Route source defines which IP address should be used as the source for packets routed via a specific route
Implementations§
source§impl RouteEntry
impl RouteEntry
pub const USE_DEFAULT_METRIC: i64 = -1i64
pub const USE_DEFAULT_ROUTE_TABLE: u32 = 0u32
pub fn new() -> Self
Trait Implementations§
source§impl Clone for RouteEntry
impl Clone for RouteEntry
source§fn clone(&self) -> RouteEntry
fn clone(&self) -> RouteEntry
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for RouteEntry
impl Debug for RouteEntry
source§impl Default for RouteEntry
impl Default for RouteEntry
source§fn default() -> RouteEntry
fn default() -> RouteEntry
source§impl<'de> Deserialize<'de> for RouteEntry
impl<'de> Deserialize<'de> for RouteEntry
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>,
source§impl Display for RouteEntry
impl Display for RouteEntry
source§impl Hash for RouteEntry
impl Hash for RouteEntry
source§impl Ord for RouteEntry
impl Ord for RouteEntry
source§impl PartialEq for RouteEntry
impl PartialEq for RouteEntry
source§impl PartialOrd for RouteEntry
impl PartialOrd for RouteEntry
source§impl Serialize for RouteEntry
impl Serialize for RouteEntry
impl Eq for RouteEntry
Auto Trait Implementations§
impl Freeze for RouteEntry
impl RefUnwindSafe for RouteEntry
impl Send for RouteEntry
impl Sync for RouteEntry
impl Unpin for RouteEntry
impl UnwindSafe for RouteEntry
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.