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.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Route
impl RefUnwindSafe for Route
impl Send for Route
impl Sync for Route
impl Unpin for Route
impl UnwindSafe for Route
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
Mutably borrows from an owned value. Read more