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.
|
||||
#[derive(Debug)]
|
||||
#[allow(unused)]
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct PeerInfo {
|
||||
/// Announced capabilities of the peer
|
||||
pub(crate) capabilities: Arc<Capabilities>,
|
||||
pub capabilities: Arc<Capabilities>,
|
||||
/// The identifier of the remote peer
|
||||
pub(crate) remote_id: PeerId,
|
||||
pub remote_id: PeerId,
|
||||
/// The client's name and version
|
||||
pub(crate) client_version: String,
|
||||
pub client_version: String,
|
||||
/// The address we're connected to
|
||||
pub(crate) remote_addr: SocketAddr,
|
||||
pub remote_addr: SocketAddr,
|
||||
/// The direction of the session
|
||||
pub(crate) direction: Direction,
|
||||
pub direction: Direction,
|
||||
}
|
||||
|
||||
/// Events a pending session can produce.
|
||||
|
||||
@ -595,8 +595,8 @@ pub(crate) enum PendingSessionHandshakeError {
|
||||
}
|
||||
|
||||
/// The direction of the connection.
|
||||
#[derive(Debug, Copy, Clone)]
|
||||
pub(crate) enum Direction {
|
||||
#[derive(Debug, Copy, Clone, PartialEq, Eq)]
|
||||
pub enum Direction {
|
||||
/// Incoming connection.
|
||||
Incoming,
|
||||
/// Outgoing connection to a specific node.
|
||||
|
||||
Reference in New Issue
Block a user