Struct cidr_utils::cidr::Ipv4Cidr[][src]

pub struct Ipv4Cidr { /* fields omitted */ }

To represent IPv4 CIDR.

Implementations

impl Ipv4Cidr[src]

pub fn get_prefix(&self) -> u32[src]

Get an integer which represents the prefix an IPv4 byte array of this CIDR in big-endian (BE) order.

pub fn get_prefix_as_u8_array(&self) -> [u8; 4][src]

pub fn get_prefix_as_ipv4_addr(&self) -> Ipv4Addr[src]

pub fn get_bits(&self) -> u8[src]

pub fn get_mask(&self) -> u32[src]

Get an integer which represents the mask an IPv4 byte array of this CIDR in big-endian (BE) order.

pub fn get_mask_as_u8_array(&self) -> [u8; 4][src]

pub fn get_mask_as_ipv4_addr(&self) -> Ipv4Addr[src]

impl Ipv4Cidr[src]

pub fn from_prefix_and_bits<P: Ipv4Able>(
    prefix: P,
    bits: u8
) -> Result<Ipv4Cidr, Ipv4CidrError>
[src]

pub fn from_prefix_and_mask<P: Ipv4Able, M: Ipv4Able>(
    prefix: P,
    mask: M
) -> Result<Ipv4Cidr, Ipv4CidrError>
[src]

pub fn from_str<S: AsRef<str>>(s: S) -> Result<Ipv4Cidr, Ipv4CidrError>[src]

pub fn is_ipv4_cidr<S: AsRef<str>>(s: S) -> bool[src]

impl Ipv4Cidr[src]

pub fn first(&self) -> u32[src]

Get an integer which represents the first IPv4 byte array of this CIDR in big-endian (BE) order.

pub fn first_as_u8_array(&self) -> [u8; 4][src]

pub fn first_as_ipv4_addr(&self) -> Ipv4Addr[src]

pub fn last(&self) -> u32[src]

Get an integer which represents the last IPv4 byte array of this CIDR in big-endian (BE) order.

pub fn last_as_u8_array(&self) -> [u8; 4][src]

pub fn last_as_ipv4_addr(&self) -> Ipv4Addr[src]

pub fn size(&self) -> u64[src]

impl Ipv4Cidr[src]

pub fn contains<IP: Ipv4Able>(&self, ipv4: IP) -> bool[src]

impl Ipv4Cidr[src]

impl Ipv4Cidr[src]

pub fn iter(&self) -> Ipv4CidrIterator

Notable traits for Ipv4CidrIterator

impl Iterator for Ipv4CidrIterator type Item = u32;
[src]

impl Ipv4Cidr[src]

Trait Implementations

impl Clone for Ipv4Cidr[src]

impl Copy for Ipv4Cidr[src]

impl Debug for Ipv4Cidr[src]

impl Display for Ipv4Cidr[src]

impl Eq for Ipv4Cidr[src]

impl FromStr for Ipv4Cidr[src]

type Err = Ipv4CidrError

The associated error which can be returned from parsing.

impl Hash for Ipv4Cidr[src]

impl Ord for Ipv4Cidr[src]

impl PartialEq<IpCidr> for Ipv4Cidr[src]

impl PartialEq<Ipv4Cidr> for Ipv4Cidr[src]

impl PartialEq<Ipv4Cidr> for IpCidr[src]

impl PartialOrd<IpCidr> for Ipv4Cidr[src]

impl PartialOrd<Ipv4Cidr> for Ipv4Cidr[src]

impl PartialOrd<Ipv4Cidr> for IpCidr[src]

impl StructuralEq for Ipv4Cidr[src]

impl StructuralPartialEq for Ipv4Cidr[src]

impl TryFrom<&'_ str> for Ipv4Cidr[src]

type Error = Ipv4CidrError

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<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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.