Struct netsim::Ipv4Route [−][src]
pub struct Ipv4Route { /* fields omitted */ }
Represents an IPv4 route.
Methods
impl Ipv4Route
[src]
impl Ipv4Route
pub fn new(destination: Ipv4Range, gateway: Option<Ipv4Addr>) -> Ipv4Route
[src]
pub fn new(destination: Ipv4Range, gateway: Option<Ipv4Addr>) -> Ipv4Route
Create a new route with the given destination and gateway
pub fn destination(&self) -> Ipv4Range
[src]
pub fn destination(&self) -> Ipv4Range
Get the destination IP range of the route.
pub fn gateway(&self) -> Option<Ipv4Addr>
[src]
pub fn gateway(&self) -> Option<Ipv4Addr>
Get the route's gateway (if any).
pub fn add_to_routing_table(self, iface_name: &str) -> Result<(), AddRouteError>
[src]
pub fn add_to_routing_table(self, iface_name: &str) -> Result<(), AddRouteError>
Add the route to the routing table of the current network namespace.
Trait Implementations
impl Debug for Ipv4Route
[src]
impl Debug for Ipv4Route
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for Ipv4Route
[src]
impl Clone for Ipv4Route
fn clone(&self) -> Ipv4Route
[src]
fn clone(&self) -> Ipv4Route
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl Copy for Ipv4Route
[src]
impl Copy for Ipv4Route