Struct rtnetlink::RuleAddRequest
source · pub struct RuleAddRequest<T = ()> { /* private fields */ }
Expand description
A request to create a new rule. This is equivalent to the ip rule add
command.
Implementations§
source§impl<T> RuleAddRequest<T>
impl<T> RuleAddRequest<T>
sourcepub fn input_interface(self, ifname: String) -> Self
pub fn input_interface(self, ifname: String) -> Self
Sets the input interface name.
sourcepub fn output_interface(self, ifname: String) -> Self
pub fn output_interface(self, ifname: String) -> Self
Sets the output interface name.
sourcepub fn v4(self) -> RuleAddRequest<Ipv4Addr>
pub fn v4(self) -> RuleAddRequest<Ipv4Addr>
Build an IP v4 rule
sourcepub fn v6(self) -> RuleAddRequest<Ipv6Addr>
pub fn v6(self) -> RuleAddRequest<Ipv6Addr>
Build an IP v6 rule
pub fn message_mut(&mut self) -> &mut RuleMessage
source§impl RuleAddRequest<Ipv4Addr>
impl RuleAddRequest<Ipv4Addr>
sourcepub fn source_prefix(self, addr: Ipv4Addr, prefix_length: u8) -> Self
pub fn source_prefix(self, addr: Ipv4Addr, prefix_length: u8) -> Self
Sets the source address prefix.
sourcepub fn destination_prefix(self, addr: Ipv4Addr, prefix_length: u8) -> Self
pub fn destination_prefix(self, addr: Ipv4Addr, prefix_length: u8) -> Self
Sets the destination address prefix.
source§impl RuleAddRequest<Ipv6Addr>
impl RuleAddRequest<Ipv6Addr>
sourcepub fn source_prefix(self, addr: Ipv6Addr, prefix_length: u8) -> Self
pub fn source_prefix(self, addr: Ipv6Addr, prefix_length: u8) -> Self
Sets the source address prefix.
sourcepub fn destination_prefix(self, addr: Ipv6Addr, prefix_length: u8) -> Self
pub fn destination_prefix(self, addr: Ipv6Addr, prefix_length: u8) -> Self
Sets the destination address prefix.
Auto Trait Implementations§
impl<T> Freeze for RuleAddRequest<T>
impl<T = ()> !RefUnwindSafe for RuleAddRequest<T>
impl<T> Send for RuleAddRequest<T>where
T: Send,
impl<T> Sync for RuleAddRequest<T>where
T: Sync,
impl<T> Unpin for RuleAddRequest<T>where
T: Unpin,
impl<T = ()> !UnwindSafe for RuleAddRequest<T>
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