pub enum IpInetPair {
V4(Ipv4InetPair),
V6(Ipv6InetPair),
}
Expand description
InetPair
type representing either a pair of IPv4 host or a pair of IPv6
hosts within a network
Variants§
Implementations§
source§impl IpInetPair
impl IpInetPair
sourcepub const fn new(first: IpInet, second: IpInet) -> Result<Self, InetTupleError>
pub const fn new(first: IpInet, second: IpInet) -> 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: IpAddr,
second: IpAddr,
len: u8,
) -> Result<Self, InetTupleError>
pub const fn new_from_addresses( first: IpAddr, second: IpAddr, 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<IpAddr> ⓘ
pub const fn iter(self) -> InetIterator<IpAddr> ⓘ
Iterate over first..=second
(inclusive)
Trait Implementations§
source§impl Clone for IpInetPair
impl Clone for IpInetPair
source§fn clone(&self) -> IpInetPair
fn clone(&self) -> IpInetPair
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 IpInetPair
impl Debug for IpInetPair
source§impl Display for IpInetPair
impl Display for IpInetPair
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 From<Ipv6InetPair> for IpInetPair
impl From<Ipv6InetPair> for IpInetPair
source§fn from(c: Ipv6InetPair) -> Self
fn from(c: Ipv6InetPair) -> Self
Converts to this type from the input type.
source§impl Hash for IpInetPair
impl Hash for IpInetPair
source§impl InetPair for IpInetPair
impl InetPair for IpInetPair
source§fn new(first: IpInet, second: IpInet) -> Result<Self, InetTupleError>
fn new(first: IpInet, second: IpInet) -> Result<Self, InetTupleError>
Create new pair from two addresses in the same network Read more
source§fn new_from_addresses(
first: IpAddr,
second: IpAddr,
len: u8,
) -> Result<Self, InetTupleError>
fn new_from_addresses( first: IpAddr, second: IpAddr, 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 IpInetPair
impl IntoIterator for IpInetPair
source§impl PartialEq for IpInetPair
impl PartialEq for IpInetPair
impl Copy for IpInetPair
impl Eq for IpInetPair
impl StructuralPartialEq for IpInetPair
Auto Trait Implementations§
impl Freeze for IpInetPair
impl RefUnwindSafe for IpInetPair
impl Send for IpInetPair
impl Sync for IpInetPair
impl Unpin for IpInetPair
impl UnwindSafe for IpInetPair
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
)