pub struct ConnectionInfo {
pub peer_id: PeerId,
pub remote_address: SocketAddr,
pub connected_at: Instant,
pub bytes_sent: u64,
pub bytes_received: u64,
pub last_activity: Instant,
pub rtt: Option<Duration>,
pub packet_loss: f64,
pub nat_type: String,
}
Expand description
Connection information
Fields§
§peer_id: PeerId
Peer identifier
remote_address: SocketAddr
Remote socket address
connected_at: Instant
Timestamp when the connection was established
bytes_sent: u64
Total bytes sent
bytes_received: u64
Total bytes received
last_activity: Instant
Timestamp of last activity
rtt: Option<Duration>
Measured round trip time
packet_loss: f64
Packet loss ratio [0.0-1.0]
nat_type: String
NAT type inferred for the peer
Trait Implementations§
Source§impl Clone for ConnectionInfo
impl Clone for ConnectionInfo
Source§fn clone(&self) -> ConnectionInfo
fn clone(&self) -> ConnectionInfo
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for ConnectionInfo
impl RefUnwindSafe for ConnectionInfo
impl Send for ConnectionInfo
impl Sync for ConnectionInfo
impl Unpin for ConnectionInfo
impl UnwindSafe for ConnectionInfo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more