[−][src]Struct ipstuff::Ipv4Mask
A 4-byte type representing a subnet mask. This type can only be a valid subnet mask.
Implementations
impl Ipv4Mask
[src]
pub const fn new(len: u8) -> Self
[src]
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.
fn from_str(s: &str) -> Result<Self, InvalidIpv4Mask>
[src]
impl Hash for Ipv4Mask
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl IpBitwiseExt<Ipv4Mask> for Ipv4Addr
[src]
type Output = Self
The output type of this operation.
fn bitand(self, rhs: Ipv4Mask) -> Self
[src]
fn bitor(self, rhs: Ipv4Mask) -> Self
[src]
fn bitxor(self, rhs: Ipv4Mask) -> Self
[src]
impl Not for Ipv4Mask
[src]
impl PartialEq<Ipv4Mask> for Ipv4Mask
[src]
impl StructuralEq for Ipv4Mask
[src]
impl StructuralPartialEq for Ipv4Mask
[src]
Auto Trait Implementations
impl RefUnwindSafe for Ipv4Mask
impl Send for Ipv4Mask
impl Sync for Ipv4Mask
impl Unpin for Ipv4Mask
impl UnwindSafe for Ipv4Mask
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,
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.
fn to_owned(&self) -> T
[src]
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.
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>,