pub struct ConnectionLifecycle {
pub conn_id: ConnectionId,
pub role: ConnectionRole,
pub state: ConnectionState,
pub initiated_at: Instant,
pub handshake_started_at: Option<Instant>,
pub established_at: Option<Instant>,
pub closed_at: Option<Instant>,
pub close_reason: Option<String>,
pub total_bytes_sent: u64,
pub total_bytes_received: u64,
pub total_packets_sent: u64,
pub total_packets_received: u64,
}Expand description
Connection lifecycle tracker
Fields§
§conn_id: ConnectionId§role: ConnectionRole§state: ConnectionState§initiated_at: Instant§handshake_started_at: Option<Instant>§established_at: Option<Instant>§closed_at: Option<Instant>§close_reason: Option<String>§total_bytes_sent: u64§total_bytes_received: u64§total_packets_sent: u64§total_packets_received: u64Implementations§
Source§impl ConnectionLifecycle
impl ConnectionLifecycle
Sourcepub fn new(conn_id: ConnectionId, role: ConnectionRole) -> Self
pub fn new(conn_id: ConnectionId, role: ConnectionRole) -> Self
Create a new connection lifecycle tracker
Sourcepub fn update_state(&mut self, new_state: ConnectionState)
pub fn update_state(&mut self, new_state: ConnectionState)
Update connection state
Sourcepub fn log_summary(&self)
pub fn log_summary(&self)
Log connection summary when closed
Auto Trait Implementations§
impl Freeze for ConnectionLifecycle
impl RefUnwindSafe for ConnectionLifecycle
impl Send for ConnectionLifecycle
impl Sync for ConnectionLifecycle
impl Unpin for ConnectionLifecycle
impl UnwindSafe for ConnectionLifecycle
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