pub struct RouteNextHopBuilder { /* private fields */ }Implementations§
Source§impl RouteNextHopBuilder
impl RouteNextHopBuilder
Sourcepub fn new(address_family: AddressFamily) -> Self
pub fn new(address_family: AddressFamily) -> Self
Create default RouteNexthop for a route with the given address family.
Sourcepub fn via(self, addr: IpAddr) -> Result<Self, InvalidRouteMessage>
pub fn via(self, addr: IpAddr) -> Result<Self, InvalidRouteMessage>
Sets the nexthop (via) address.
Sourcepub fn onlink(self) -> Self
pub fn onlink(self) -> Self
Marks the nexthop as directly reachable (on-link).
Indicates that the nexthop is reachable without passing through a connected subnet.
Sourcepub fn weight(self, weight: u8) -> Self
pub fn weight(self, weight: u8) -> Self
Set the nexthop weight
Equal to weight property in ip route, but please be advised the
number shown in ip route command has plus 1. Meaning kernel has
weight 0, but ip route shows as weight 1. This function is using
kernel number from range of 0 to 255.
Sourcepub fn flags(self, flags: RouteNextHopFlags) -> Self
pub fn flags(self, flags: RouteNextHopFlags) -> Self
Set flags for next hop
pub fn build(self) -> RouteNextHop
Trait Implementations§
Source§impl Clone for RouteNextHopBuilder
impl Clone for RouteNextHopBuilder
Source§fn clone(&self) -> RouteNextHopBuilder
fn clone(&self) -> RouteNextHopBuilder
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for RouteNextHopBuilder
impl RefUnwindSafe for RouteNextHopBuilder
impl Send for RouteNextHopBuilder
impl Sync for RouteNextHopBuilder
impl Unpin for RouteNextHopBuilder
impl UnwindSafe for RouteNextHopBuilder
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