mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
fix(net): export PeerInfo fields and derive Clone (#977)
This commit is contained in:
@ -65,19 +65,18 @@ impl ActiveSessionHandle {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Info about an active peer session.
|
/// Info about an active peer session.
|
||||||
#[derive(Debug)]
|
#[derive(Debug, Clone)]
|
||||||
#[allow(unused)]
|
|
||||||
pub struct PeerInfo {
|
pub struct PeerInfo {
|
||||||
/// Announced capabilities of the peer
|
/// Announced capabilities of the peer
|
||||||
pub(crate) capabilities: Arc<Capabilities>,
|
pub capabilities: Arc<Capabilities>,
|
||||||
/// The identifier of the remote peer
|
/// The identifier of the remote peer
|
||||||
pub(crate) remote_id: PeerId,
|
pub remote_id: PeerId,
|
||||||
/// The client's name and version
|
/// The client's name and version
|
||||||
pub(crate) client_version: String,
|
pub client_version: String,
|
||||||
/// The address we're connected to
|
/// The address we're connected to
|
||||||
pub(crate) remote_addr: SocketAddr,
|
pub remote_addr: SocketAddr,
|
||||||
/// The direction of the session
|
/// The direction of the session
|
||||||
pub(crate) direction: Direction,
|
pub direction: Direction,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Events a pending session can produce.
|
/// Events a pending session can produce.
|
||||||
|
|||||||
@ -595,8 +595,8 @@ pub(crate) enum PendingSessionHandshakeError {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// The direction of the connection.
|
/// The direction of the connection.
|
||||||
#[derive(Debug, Copy, Clone)]
|
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
|
||||||
pub(crate) enum Direction {
|
pub enum Direction {
|
||||||
/// Incoming connection.
|
/// Incoming connection.
|
||||||
Incoming,
|
Incoming,
|
||||||
/// Outgoing connection to a specific node.
|
/// Outgoing connection to a specific node.
|
||||||
|
|||||||
Reference in New Issue
Block a user