pub struct Session { /* private fields */ }Expand description
A MoQ transport session, wrapping a WebTransport connection.
Returned by crate::Client::connect and crate::Server::accept, paired with
the Driver that runs its protocol work. Nothing is spawned behind your back:
the session makes no progress unless its driver is polled.
Like every handle in this library, the lifecycle is reference counted: clones
share the connection, the transport closes when the last clone drops, and
abort closes it explicitly with an error. The Driver holds
no Session clone, so handing it to an executor never keeps the session alive.
Implementations§
Source§impl Session
impl Session
Sourcepub fn send_bandwidth(&self) -> Option<Consumer>
pub fn send_bandwidth(&self) -> Option<Consumer>
Returns a consumer for the estimated send bitrate (from the congestion controller).
Returns None if the QUIC backend doesn’t support bandwidth estimation.
Sourcepub fn recv_bandwidth(&self) -> Option<Consumer>
pub fn recv_bandwidth(&self) -> Option<Consumer>
Returns a consumer for the estimated receive bitrate (from PROBE).
Returns None if the MoQ version doesn’t support PROBE (requires moq-lite-03+).
Sourcepub fn stats(&self) -> ConnectionStats
pub fn stats(&self) -> ConnectionStats
Returns a snapshot of the current connection statistics.
This is a cheap, non-blocking read of the underlying transport’s counters; see
ConnectionStats for which metrics each backend reports.