Struct netsim::Ipv6Range[][src]

pub struct Ipv6Range { /* fields omitted */ }

A range of IPv6 addresses with a common prefix

Methods

impl Ipv6Range
[src]

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)

Return the entire IPv6 range, ::/0

Get the netmask as an IPv6 address

Get the number of netmask prefix bits

Get the base address of the range, ie. the lowest IP address which is part of the range.

Check whether this range contains the given IP address

Important traits for Vec<u8>

Split a range into num sub-ranges

Panics

If the range is too small to be split up that much.

Get a random IP address from the range which is not the base address or the default for the gateway address.

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]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Copy for Ipv6Range
[src]

impl Debug for Ipv6Range
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl Send for Ipv6Range

impl Sync for Ipv6Range