pub struct Route {
pub cidr: IpCidr,
pub via_router: IpAddress,
pub preferred_until: Option<Instant>,
pub expires_at: Option<Instant>,
}
Expand description
A prefix of addresses that should be routed via a router
Fields§
§cidr: IpCidr
§via_router: IpAddress
§preferred_until: Option<Instant>
None
means “forever”.
expires_at: Option<Instant>
None
means “forever”.
Implementations§
source§impl Route
impl Route
sourcepub fn new_ipv4_gateway(gateway: Ipv4Address) -> Route
pub fn new_ipv4_gateway(gateway: Ipv4Address) -> Route
Returns a route to 0.0.0.0/0 via the gateway
, with no expiry.
sourcepub fn new_ipv6_gateway(gateway: Ipv6Address) -> Route
pub fn new_ipv6_gateway(gateway: Ipv6Address) -> Route
Returns a route to ::/0 via the gateway
, with no expiry.