Struct default_net::ip::Ipv4Net
source · pub struct Ipv4Net {
pub addr: Ipv4Addr,
pub prefix_len: u8,
pub netmask: Ipv4Addr,
}
Expand description
Structure of IPv4 Network
Fields§
§addr: Ipv4Addr
IPv4 Address
prefix_len: u8
Prefix Length
netmask: Ipv4Addr
Network Mask
Implementations§
source§impl Ipv4Net
impl Ipv4Net
sourcepub fn new(ipv4_addr: Ipv4Addr, prefix_len: u8) -> Ipv4Net
pub fn new(ipv4_addr: Ipv4Addr, prefix_len: u8) -> Ipv4Net
Construct a new Ipv4Net instance from IPv4 Address and Prefix Length
sourcepub fn new_with_netmask(ipv4_addr: Ipv4Addr, netmask: Ipv4Addr) -> Ipv4Net
pub fn new_with_netmask(ipv4_addr: Ipv4Addr, netmask: Ipv4Addr) -> Ipv4Net
Construct a new Ipv4Net instance from IPv4 Address and Network Mask
sourcepub const fn max_prefix_len(&self) -> u8
pub const fn max_prefix_len(&self) -> u8
Returns the maximum valid prefix length.
Trait Implementations§
source§impl Ord for Ipv4Net
impl Ord for Ipv4Net
source§impl PartialEq for Ipv4Net
impl PartialEq for Ipv4Net
source§impl PartialOrd for Ipv4Net
impl PartialOrd for Ipv4Net
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for Ipv4Net
impl Eq for Ipv4Net
impl StructuralPartialEq for Ipv4Net
Auto Trait Implementations§
impl RefUnwindSafe for Ipv4Net
impl Send for Ipv4Net
impl Sync for Ipv4Net
impl Unpin for Ipv4Net
impl UnwindSafe for Ipv4Net
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