[][src]Struct ipstuff::Ipv4Mask

pub struct Ipv4Mask { /* fields omitted */ }

Methods

impl Ipv4Mask[src]

pub const fn new(len: u8) -> Self[src]

Returns a mask with the specified length.

Panics

Will panic if provided length is > 32

pub fn from_bytes(bytes: [u8; 4]) -> Option<Self>[src]

Constructs a subnet mask from the provided bytes, if they represent a valid mask.

pub fn from_u32(x: u32) -> Option<Self>[src]

Constructs a subnet mask from the provided u32, if it represents a valid mask.

pub const fn octets(self) -> [u8; 4][src]

Returns the subnet mask as an array of bytes.

pub const fn as_u32(self) -> u32[src]

Returns this mask in u32 representation

pub const fn len(self) -> u8[src]

Returns the length of the mask. That is, the number of 1 bits in this mask.

Trait Implementations

impl Clone for Ipv4Mask[src]

impl Copy for Ipv4Mask[src]

impl Debug for Ipv4Mask[src]

impl Display for Ipv4Mask[src]

impl Eq for Ipv4Mask[src]

impl FromStr for Ipv4Mask[src]

type Err = InvalidIpv4Mask

The associated error which can be returned from parsing.

impl Hash for Ipv4Mask[src]

impl IpBitwiseExt<Ipv4Mask> for Ipv4Addr[src]

type Output = Self

impl Not for Ipv4Mask[src]

type Output = [u8; 4]

The resulting type after applying the ! operator.

impl PartialEq<Ipv4Mask> for Ipv4Mask[src]

impl StructuralEq for Ipv4Mask[src]

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