pub struct SubnetMask {
pub ipv4: u32,
pub ipv6: u128,
}Expand description
Prefix lengths (in bits) used to derive canonical subnets for IPv4 and IPv6 addresses.
Fields§
§ipv4: u32§ipv6: u128Implementations§
Source§impl SubnetMask
impl SubnetMask
Sourcepub const fn new(ipv4_bits: u8, ipv6_bits: u8) -> Self
pub const fn new(ipv4_bits: u8, ipv6_bits: u8) -> Self
Create a new SubnetMask. Values greater than the address width are clamped when applied.
Trait Implementations§
Source§impl Clone for SubnetMask
impl Clone for SubnetMask
Source§fn clone(&self) -> SubnetMask
fn clone(&self) -> SubnetMask
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SubnetMask
impl Debug for SubnetMask
Source§impl Hash for SubnetMask
impl Hash for SubnetMask
Source§impl PartialEq for SubnetMask
impl PartialEq for SubnetMask
impl Copy for SubnetMask
impl Eq for SubnetMask
impl StructuralPartialEq for SubnetMask
Auto Trait Implementations§
impl Freeze for SubnetMask
impl RefUnwindSafe for SubnetMask
impl Send for SubnetMask
impl Sync for SubnetMask
impl Unpin for SubnetMask
impl UnwindSafe for SubnetMask
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more