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]
prefix: P,
bits: u8
) -> Result<Ipv4Cidr, Ipv4CidrError>
pub fn from_prefix_and_mask<P: Ipv4Able, M: Ipv4Able>(
prefix: P,
mask: M
) -> Result<Ipv4Cidr, Ipv4CidrError>
[src]
prefix: P,
mask: M
) -> Result<Ipv4Cidr, Ipv4CidrError>
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]
impl Ipv4Cidr
[src]
pub fn iter_as_u8_array(&self) -> Ipv4CidrU8ArrayIteratorⓘNotable traits for Ipv4CidrU8ArrayIterator
impl Iterator for Ipv4CidrU8ArrayIterator type Item = [u8; 4];
[src]
Notable traits for Ipv4CidrU8ArrayIterator
impl Iterator for Ipv4CidrU8ArrayIterator type Item = [u8; 4];
impl Ipv4Cidr
[src]
pub fn iter(&self) -> Ipv4CidrIteratorⓘNotable traits for Ipv4CidrIterator
impl Iterator for Ipv4CidrIterator type Item = u32;
[src]
Notable traits for Ipv4CidrIterator
impl Iterator for Ipv4CidrIterator type Item = u32;
impl Ipv4Cidr
[src]
pub fn iter_as_ipv4_addr(&self) -> Ipv4CidrIpv4AddrIteratorⓘNotable traits for Ipv4CidrIpv4AddrIterator
impl Iterator for Ipv4CidrIpv4AddrIterator type Item = Ipv4Addr;
[src]
Notable traits for Ipv4CidrIpv4AddrIterator
impl Iterator for Ipv4CidrIpv4AddrIterator type Item = Ipv4Addr;
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.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl Hash for Ipv4Cidr
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for Ipv4Cidr
[src]
fn cmp(&self, other: &Ipv4Cidr) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]
pub fn max(self, other: Self) -> Self#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]
pub fn min(self, other: Self) -> Self#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
#[must_use]
pub fn clamp(self, min: Self, max: Self) -> Selfimpl PartialEq<IpCidr> for Ipv4Cidr
[src]
impl PartialEq<Ipv4Cidr> for Ipv4Cidr
[src]
impl PartialEq<Ipv4Cidr> for IpCidr
[src]
fn eq(&self, other: &Ipv4Cidr) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn ne(&self, other: &Rhs) -> boolimpl PartialOrd<IpCidr> for Ipv4Cidr
[src]
fn partial_cmp(&self, other: &IpCidr) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn lt(&self, other: &Rhs) -> bool#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn le(&self, other: &Rhs) -> bool#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn gt(&self, other: &Rhs) -> bool#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn ge(&self, other: &Rhs) -> boolimpl PartialOrd<Ipv4Cidr> for Ipv4Cidr
[src]
fn partial_cmp(&self, other: &Ipv4Cidr) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn lt(&self, other: &Rhs) -> bool#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn le(&self, other: &Rhs) -> bool#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn gt(&self, other: &Rhs) -> bool#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn ge(&self, other: &Rhs) -> boolimpl PartialOrd<Ipv4Cidr> for IpCidr
[src]
fn partial_cmp(&self, other: &Ipv4Cidr) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn lt(&self, other: &Rhs) -> bool#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn le(&self, other: &Rhs) -> bool#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn gt(&self, other: &Rhs) -> bool#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]
pub fn ge(&self, other: &Rhs) -> boolimpl StructuralEq for Ipv4Cidr
[src]
impl StructuralPartialEq for Ipv4Cidr
[src]
impl TryFrom<&'_ str> for Ipv4Cidr
[src]
Auto Trait Implementations
impl RefUnwindSafe for Ipv4Cidr
impl Send for Ipv4Cidr
impl Sync for Ipv4Cidr
impl Unpin for Ipv4Cidr
impl UnwindSafe for Ipv4Cidr
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,