cidr/inet_pair/
mod.rs

1mod combined;
2mod direct;
3
4use std::net::{
5	Ipv4Addr,
6	Ipv6Addr,
7};
8
9/// [`InetPair`] type representing a pair of IPv4 hosts within a network
10///
11/// [`InetPair`]: crate::InetPair
12#[derive(Clone, Copy, PartialEq, Eq, Hash)]
13pub struct Ipv4InetPair {
14	pub(crate) first: Ipv4Addr,
15	pub(crate) second: Ipv4Addr,
16	pub(crate) network_length: u8,
17}
18
19/// [`InetPair`] type representing a pair of IPv6 hosts within a network
20///
21/// [`InetPair`]: crate::InetPair
22#[derive(Clone, Copy, PartialEq, Eq, Hash)]
23pub struct Ipv6InetPair {
24	pub(crate) first: Ipv6Addr,
25	pub(crate) second: Ipv6Addr,
26	pub(crate) network_length: u8,
27}
28
29/// [`InetPair`] type representing either a pair of IPv4 host or a pair of IPv6
30/// hosts within a network
31///
32/// [`InetPair`]: crate::InetPair
33#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug)]
34pub enum IpInetPair {
35	/// IPv4 host within network
36	V4(Ipv4InetPair),
37	/// IPv6 host within network
38	V6(Ipv6InetPair),
39}