pub struct ConnectionStatsReader { /* private fields */ }Expand description
A cloneable read handle for the live connection stats of a Reconnect loop.
Obtained via Reconnect::stats. stats returns None while the loop is
between connections (reconnecting), and Some snapshot while a session is established.
Implementations§
Source§impl ConnectionStatsReader
impl ConnectionStatsReader
Sourcepub fn presence(&self) -> Presence
pub fn presence(&self) -> Presence
Cumulative connects and disconnects of this reconnect loop, the same shape as a relay’s
sessions track: sessions - sessions_closed is 1 while connected, and a rate is a delta over
any window.
Sourcepub fn poll_presence(&mut self, waiter: &Waiter) -> Poll<Result<Presence>>
pub fn poll_presence(&mut self, waiter: &Waiter) -> Poll<Result<Presence>>
Poll until either presence counter moves past what this handle last reported.
Sourcepub async fn presence_changed(&mut self) -> Result<Presence>
pub async fn presence_changed(&mut self) -> Result<Presence>
Wait until either presence counter moves past what this handle last reported.
Unlike Reconnect::status, a connect and disconnect that both land before the caller polls
are not coalesced away: the counters still moved.
Sourcepub fn stats(&self) -> Option<ConnectionStats>
pub fn stats(&self) -> Option<ConnectionStats>
Snapshot the current connection’s stats, or None if not currently connected.
Sourcepub fn snapshot(&self) -> Option<ConnectionSnapshot>
pub fn snapshot(&self) -> Option<ConnectionSnapshot>
Snapshot statistics and protocol together, or None while disconnected.
Trait Implementations§
Source§impl Clone for ConnectionStatsReader
impl Clone for ConnectionStatsReader
Source§fn clone(&self) -> ConnectionStatsReader
fn clone(&self) -> ConnectionStatsReader
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more