ant_protocol/messages/connection_info.rs
1use libp2p::Multiaddr;
2use libp2p::PeerId;
3use std::fmt::Display;
4
5#[derive(Debug, Clone)]
6pub struct ConnectionInfo {
7 /// The Peer ID of the peer that sent the response.
8 pub peer_id: PeerId,
9 /// The origin of the response.
10 pub response_origin: Multiaddr,
11}
12
13impl Display for ConnectionInfo {
14 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
15 write!(
16 f,
17 "ConnectionInfo (peer_id: {}, multiaddr: {})",
18 self.peer_id, self.response_origin
19 )
20 }
21}