pub struct Ipv4InetPair { /* private fields */ }
Expand description
InetPair
type representing a pair of IPv4 hosts within a network
Implementations§
source§impl Ipv4InetPair
impl Ipv4InetPair
sourcepub const fn new(
first: Ipv4Inet,
second: Ipv4Inet,
) -> Result<Self, InetTupleError>
pub const fn new( first: Ipv4Inet, second: Ipv4Inet, ) -> Result<Self, InetTupleError>
Create new pair from two addresses in the same network
Fails if the addresses are not in the same network.
sourcepub const fn new_from_addresses(
first: Ipv4Addr,
second: Ipv4Addr,
len: u8,
) -> Result<Self, InetTupleError>
pub const fn new_from_addresses( first: Ipv4Addr, second: Ipv4Addr, len: u8, ) -> Result<Self, InetTupleError>
Create new pair from two addresses and a common length
Fails if the network length is invalid for the addresses or the addresses are not in the same network.
sourcepub const fn network_length(&self) -> u8
pub const fn network_length(&self) -> u8
length in bits of the shared prefix of the contained addresses
sourcepub const fn iter(self) -> InetIterator<Ipv4Addr> ⓘ
pub const fn iter(self) -> InetIterator<Ipv4Addr> ⓘ
Iterate over first..=second
(inclusive)
Trait Implementations§
source§impl Clone for Ipv4InetPair
impl Clone for Ipv4InetPair
source§fn clone(&self) -> Ipv4InetPair
fn clone(&self) -> Ipv4InetPair
Returns a copy 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 Ipv4InetPair
impl Debug for Ipv4InetPair
source§impl Display for Ipv4InetPair
impl Display for Ipv4InetPair
source§impl From<Ipv4InetPair> for IpInetPair
impl From<Ipv4InetPair> for IpInetPair
source§fn from(c: Ipv4InetPair) -> Self
fn from(c: Ipv4InetPair) -> Self
Converts to this type from the input type.
source§impl Hash for Ipv4InetPair
impl Hash for Ipv4InetPair
source§impl InetPair for Ipv4InetPair
impl InetPair for Ipv4InetPair
source§fn new(first: Ipv4Inet, second: Ipv4Inet) -> Result<Self, InetTupleError>
fn new(first: Ipv4Inet, second: Ipv4Inet) -> Result<Self, InetTupleError>
Create new pair from two addresses in the same network Read more
source§fn new_from_addresses(
first: Self::Address,
second: Self::Address,
len: u8,
) -> Result<Self, InetTupleError>
fn new_from_addresses( first: Self::Address, second: Self::Address, len: u8, ) -> Result<Self, InetTupleError>
Create new pair from two addresses and a common length Read more
source§fn network_length(&self) -> u8
fn network_length(&self) -> u8
length in bits of the shared prefix of the contained addresses
source§impl IntoIterator for Ipv4InetPair
impl IntoIterator for Ipv4InetPair
Iterate over all the addresses in the CIDR.
source§impl PartialEq for Ipv4InetPair
impl PartialEq for Ipv4InetPair
impl Copy for Ipv4InetPair
impl Eq for Ipv4InetPair
impl StructuralPartialEq for Ipv4InetPair
Auto Trait Implementations§
impl Freeze for Ipv4InetPair
impl RefUnwindSafe for Ipv4InetPair
impl Send for Ipv4InetPair
impl Sync for Ipv4InetPair
impl Unpin for Ipv4InetPair
impl UnwindSafe for Ipv4InetPair
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)