Struct dia_ip_range::IPv4Range[][src]

pub struct IPv4Range { /* fields omitted */ }

IPv4 range

A range can be respresented in string, following these rules:

  • Start and end are placed inside one of [], [)…, separated by a comma.
  • [ and ] are inclusive.
  • ( and ) are exclusive.
  • White spaces can be included. They will be ignored by parser.
  • Length of the string must be equal to or smaller than 64 bytes. It’s for protection against flood attack.

Currently this struct is itself useless. You need to enable feature iter, in order to use IPv4RangeIter.

Examples

use {
    core::str::FromStr,
    dia_ip_range::IPv4Range,
};

assert_eq!(
    IPv4Range::from_str("10.0.0.[2,100)")?,
    IPv4Range::make([10..=10, 0..=0, 0..=0, 2..=99])?,
);

Implementations

impl IPv4Range[src]

pub fn make(components: [RangeInclusive<u8>; 4]) -> Result<Self>[src]

Makes new instance

An error is returned if any component is empty.

Trait Implementations

impl Clone for IPv4Range[src]

impl Debug for IPv4Range[src]

impl Eq for IPv4Range[src]

impl FromStr for IPv4Range[src]

type Err = Error

The associated error which can be returned from parsing.

impl Hash for IPv4Range[src]

impl PartialEq<IPv4Range> for IPv4Range[src]

impl StructuralEq for IPv4Range[src]

impl StructuralPartialEq for IPv4Range[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<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.