cuprated/p2p/network_address.rs
1use std::net::SocketAddr;
2
3use cuprate_p2p_core::{client::InternalPeerID, ClearNet, NetworkZone};
4
5/// An identifier for a P2P peer on any network.
6#[derive(Debug, Clone, PartialEq, Eq, Hash)]
7pub enum CrossNetworkInternalPeerId {
8 /// A clear-net peer.
9 ClearNet(InternalPeerID<<ClearNet as NetworkZone>::Addr>),
10}
11
12impl From<InternalPeerID<<ClearNet as NetworkZone>::Addr>> for CrossNetworkInternalPeerId {
13 fn from(addr: InternalPeerID<<ClearNet as NetworkZone>::Addr>) -> Self {
14 Self::ClearNet(addr)
15 }
16}