[][src]Struct ipnet::Ipv6Subnets

pub struct Ipv6Subnets { /* fields omitted */ }

An Iterator that generates IPv6 network addresses.

Generates the subnets between the provided start and end IP addresses inclusive of end. Each iteration generates the next network address of the largest valid size it can, while using a prefix lenth not less than min_prefix_len.

Examples

let subnets = Ipv6Subnets::new(
    "fd00::".parse().unwrap(),
    "fd00:ef:ffff:ffff:ffff:ffff:ffff:ffff".parse().unwrap(),
    26,
);
 
assert_eq!(subnets.collect::<Vec<Ipv6Net>>(), vec![
    "fd00::/26".parse().unwrap(),
    "fd00:40::/26".parse().unwrap(),
    "fd00:80::/26".parse().unwrap(),
    "fd00:c0::/27".parse().unwrap(),
    "fd00:e0::/28".parse().unwrap(),
]);

Methods

impl Ipv6Subnets[src]

pub fn new(start: Ipv6Addr, end: Ipv6Addr, min_prefix_len: u8) -> Self[src]

Trait Implementations

impl Clone for Ipv6Subnets[src]

impl Copy for Ipv6Subnets[src]

impl Debug for Ipv6Subnets[src]

impl Eq for Ipv6Subnets[src]

impl From<Ipv6Subnets> for IpSubnets[src]

impl FusedIterator for Ipv6Subnets[src]

impl Hash for Ipv6Subnets[src]

impl Iterator for Ipv6Subnets[src]

type Item = Ipv6Net

The type of the elements being iterated over.

impl Ord for Ipv6Subnets[src]

impl PartialEq<Ipv6Subnets> for Ipv6Subnets[src]

impl PartialOrd<Ipv6Subnets> for Ipv6Subnets[src]

impl StructuralEq for Ipv6Subnets[src]

impl StructuralPartialEq for Ipv6Subnets[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.