Struct dia_ip_range::IPv4RangeIter[][src]

pub struct IPv4RangeIter { /* fields omitted */ }

IPv4 range iter

Examples

use {
    core::str::FromStr,
    std::net::{IpAddr, Ipv4Addr},
    dia_ip_range::IPv4RangeIter,
};

let mut iter = IPv4RangeIter::from_str("10.0.0.[2,9]")?;
for sample in vec![
    [10, 0, 0, 2], [10, 0, 0, 3], [10, 0, 0, 4], [10, 0, 0, 5],
    [10, 0, 0, 6], [10, 0, 0, 7], [10, 0, 0, 8], [10, 0, 0, 9],
] {
    assert_eq!(iter.next().unwrap(), IpAddr::from(Ipv4Addr::from(sample)));
}
assert!(iter.next().is_none());

Trait Implementations

impl Debug for IPv4RangeIter[src]

impl Eq for IPv4RangeIter[src]

impl FromStr for IPv4RangeIter[src]

type Err = Error

The associated error which can be returned from parsing.

impl Hash for IPv4RangeIter[src]

impl Iterator for IPv4RangeIter[src]

type Item = IpAddr

The type of the elements being iterated over.

impl PartialEq<IPv4RangeIter> for IPv4RangeIter[src]

impl StructuralEq for IPv4RangeIter[src]

impl StructuralPartialEq for IPv4RangeIter[src]

impl TryFrom<&'_ IPv4Range> for IPv4RangeIter[src]

type Error = Error

The type returned in the event of a conversion error.

impl TryFrom<IPv4Range> for IPv4RangeIter[src]

type Error = Error

The type returned in the event of a conversion error.

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, 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.