pub struct SrtStreamStats {
pub send: DirectionStats,
pub recv: DirectionStats,
pub rtt: RttStats,
pub buffer: BufferStats,
pub uptime_ms: u64,
pub negotiated_latency_ms: u32,
pub encryption_enabled: bool,
pub fec_enabled: bool,
pub connected_at: Instant,
}Expand description
Complete SRT stream statistics snapshot.
Fields§
§send: DirectionStatsSend-direction statistics.
recv: DirectionStatsReceive-direction statistics.
rtt: RttStatsRound-trip time statistics.
buffer: BufferStatsBuffer utilization statistics.
uptime_ms: u64Connection uptime in milliseconds (snapshot at creation, use uptime() for live).
negotiated_latency_ms: u32Latency negotiated during the SRT handshake.
encryption_enabled: boolWhether AES encryption is active on this stream.
fec_enabled: boolWhether forward-error correction is active on this stream.
connected_at: InstantTimestamp when the connection was established.
Implementations§
Source§impl SrtStreamStats
impl SrtStreamStats
Sourcepub fn new(latency_ms: u32) -> Self
pub fn new(latency_ms: u32) -> Self
Create a new statistics object for a connection with the given negotiated latency.
Sourcepub fn is_healthy(&self) -> bool
pub fn is_healthy(&self) -> bool
Returns true if the connection is considered healthy:
packet loss < 1 % and RTT < 200 ms.
Sourcepub fn quality_score(&self) -> f32
pub fn quality_score(&self) -> f32
Returns a quality score in [0.0, 1.0].
Composite of loss rate, RTT, and buffer utilization. 1.0 means perfect, 0.0 means worst.
Trait Implementations§
Source§impl Clone for SrtStreamStats
impl Clone for SrtStreamStats
Source§fn clone(&self) -> SrtStreamStats
fn clone(&self) -> SrtStreamStats
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 SrtStreamStats
impl RefUnwindSafe for SrtStreamStats
impl Send for SrtStreamStats
impl Sync for SrtStreamStats
impl Unpin for SrtStreamStats
impl UnsafeUnpin for SrtStreamStats
impl UnwindSafe for SrtStreamStats
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