Struct netsim::Ipv6Range [−][src]
pub struct Ipv6Range { /* fields omitted */ }
A range of IPv6 addresses with a common prefix
Methods
impl Ipv6Range
[src]
impl Ipv6Range
pub fn new(addr: Ipv6Addr, bits: u8) -> Ipv6Range
[src]
pub fn new(addr: Ipv6Addr, bits: u8) -> Ipv6Range
Create a range with the given base IP address and netmask prefix length.
Example
Create the subnet 2000::/12 with Ipv6Range::new(ipv6!("2000::"), 12)
pub fn global() -> Ipv6Range
[src]
pub fn global() -> Ipv6Range
Return the entire IPv6 range, ::/0
pub fn netmask(&self) -> Ipv6Addr
[src]
pub fn netmask(&self) -> Ipv6Addr
Get the netmask as an IPv6 address
pub fn netmask_prefix_length(&self) -> u8
[src]
pub fn netmask_prefix_length(&self) -> u8
Get the number of netmask prefix bits
pub fn base_addr(&self) -> Ipv6Addr
[src]
pub fn base_addr(&self) -> Ipv6Addr
Get the base address of the range, ie. the lowest IP address which is part of the range.
pub fn contains(&self, ip: Ipv6Addr) -> bool
[src]
pub fn contains(&self, ip: Ipv6Addr) -> bool
Check whether this range contains the given IP address
pub fn split(self, num: u32) -> Vec<Ipv6Range>
[src]
pub fn split(self, num: u32) -> Vec<Ipv6Range>
pub fn random_client_addr(&self) -> Ipv6Addr
[src]
pub fn random_client_addr(&self) -> Ipv6Addr
Get a random IP address from the range which is not the base address or the default for the gateway address.
pub fn next_hop_ip(&self) -> Ipv6Addr
[src]
pub fn next_hop_ip(&self) -> Ipv6Addr
Get a default IP address for the range's next hop. This is one higher than the base address of the range. eg. for 2000::/x the default address for the next hop will be 2000::1
Trait Implementations
impl Clone for Ipv6Range
[src]
impl Clone for Ipv6Range
fn clone(&self) -> Ipv6Range
[src]
fn clone(&self) -> Ipv6Range
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)
Performs copy-assignment from source
. Read more
impl Copy for Ipv6Range
[src]
impl Copy for Ipv6Range
impl Debug for Ipv6Range
[src]
impl Debug for Ipv6Range