pub struct Route {
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
via_router: IpAddresspreferred_until: Option<Instant>None means “forever”.
expires_at: Option<Instant>None means “forever”.
Implementations
sourceimpl 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 RefUnwindSafe for Route
impl Send for Route
impl Sync for Route
impl Unpin for Route
impl UnwindSafe for Route
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstablefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
fn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more