#[non_exhaustive]pub struct Route { /* private fields */ }Expand description
The way to one network: a copy of the table’s row, which
Table::lookup and Table::routes hand out.
Its fields are the table’s bookkeeping, so they are read through its
getters, and only the table’s own calls change the row: a direct route
stays direct, and the flap count and timestamps stay the table’s. Build
one with Route::direct or Route::learned, to compare with what a
lookup returns. It is #[non_exhaustive].
Implementations§
Source§impl Route
impl Route
Sourcepub const fn learned(port: PortId, next_hop: Mac, now: Instant) -> Route
pub const fn learned(port: PortId, next_hop: Mac, now: Instant) -> Route
A network reached through next_hop on port, confirmed now.
Sourcepub const fn is_direct(&self) -> bool
pub const fn is_direct(&self) -> bool
Whether the network is attached to that port, rather than reached through another router.
Sourcepub const fn next_hop(&self) -> &Mac
pub const fn next_hop(&self) -> &Mac
The next router’s MAC on that port; empty for a direct route.
Sourcepub const fn last_seen(&self) -> Option<Instant>
pub const fn last_seen(&self) -> Option<Instant>
When learning or management last confirmed the route; None for a
direct route. Aging keys off it.
Sourcepub const fn last_used(&self) -> Option<Instant>
pub const fn last_used(&self) -> Option<Instant>
When the route last carried traffic; None until it does, and again
after a move to another port. It never extends the route’s life.
Sourcepub const fn reachability(&self) -> Reachability
pub const fn reachability(&self) -> Reachability
The stored state. A lapsed busy mark still reads Busy here until
the sweep; Table::effective_reachability reads it at a time.
Sourcepub const fn busy_until(&self) -> Option<Instant>
pub const fn busy_until(&self) -> Option<Instant>
When a busy mark lapses.
Sourcepub const fn flap_count(&self) -> u8
pub const fn flap_count(&self) -> u8
Moves to another port within 60 s of the one before.
Sourcepub const fn last_port_change(&self) -> Option<Instant>
pub const fn last_port_change(&self) -> Option<Instant>
When the route last moved to another port.