pub struct RtcSnapshotState {
transport_health: BTreeMap<TransportSessionKey, TransportSessionHealth>,
receiver_bandwidth: BTreeMap<TransportSessionKey, Bitrate>,
transport_quality: BTreeMap<TransportSessionKey, TransportQualitySample>,
}Expand description
read-side RTC transport snapshot shared outside the packet loop
this state mirrors facts that diagnostics, placement and transport policy
need without exposing mutable PacketLoopState
it is protected by a cold-path mutex while packet-path state remains
worker-local and single-threaded
Fields§
§transport_health: BTreeMap<TransportSessionKey, TransportSessionHealth>latest observed transport health by session
receiver_bandwidth: BTreeMap<TransportSessionKey, Bitrate>latest receiver bandwidth estimate by session
transport_quality: BTreeMap<TransportSessionKey, TransportQualitySample>latest sampled media quality by session
Implementations§
Source§impl RtcSnapshotState
impl RtcSnapshotState
Sourcepub(super) fn remove_session(
&mut self,
session_key: &TransportSessionKey,
) -> Option<TransportSessionHealth>
pub(super) fn remove_session( &mut self, session_key: &TransportSessionKey, ) -> Option<TransportSessionHealth>
remove every read-side fact owned by one session
returns the previous transport health so teardown metrics can record the final transition without doing a second lookup
Sourcepub(super) fn set_transport_health(
&mut self,
session_key: &TransportSessionKey,
health: TransportSessionHealth,
) -> Option<TransportSessionHealth>
pub(super) fn set_transport_health( &mut self, session_key: &TransportSessionKey, health: TransportSessionHealth, ) -> Option<TransportSessionHealth>
replace the latest transport health observation for one session
returns the previous value so callers can record health transitions
Sourcepub fn transport_health(
&self,
session_key: &TransportSessionKey,
) -> Option<TransportSessionHealth>
pub fn transport_health( &self, session_key: &TransportSessionKey, ) -> Option<TransportSessionHealth>
return the latest health observation for a session
missing health means the packet loop has not observed a transport event for that session or the session was removed
Sourcepub fn transport_health_snapshot(
&self,
session_keys: &[TransportSessionKey],
) -> TransportHealthSnapshot
pub fn transport_health_snapshot( &self, session_keys: &[TransportSessionKey], ) -> TransportHealthSnapshot
Build a transport-health snapshot for the requested sessions.
Sourcepub(super) fn set_receiver_bandwidth(
&mut self,
session_key: &TransportSessionKey,
estimate: Bitrate,
) -> Option<Bitrate>
pub(super) fn set_receiver_bandwidth( &mut self, session_key: &TransportSessionKey, estimate: Bitrate, ) -> Option<Bitrate>
replace the latest receiver bandwidth estimate for one session
Sourcepub fn receiver_bandwidth_snapshot(
&self,
session_keys: &[TransportSessionKey],
) -> ReceiverBandwidthSnapshot
pub fn receiver_bandwidth_snapshot( &self, session_keys: &[TransportSessionKey], ) -> ReceiverBandwidthSnapshot
build a receiver bandwidth snapshot for the requested sessions
sessions without an estimate are omitted so callers can distinguish missing observations from a zero bitrate estimate
Sourcepub(super) fn update_transport_quality(
&mut self,
session_key: &TransportSessionKey,
update: impl FnOnce(&mut TransportQualitySample),
)
pub(super) fn update_transport_quality( &mut self, session_key: &TransportSessionKey, update: impl FnOnce(&mut TransportQualitySample), )
update sampled transport-quality observations for one session
Sourcepub fn transport_quality_snapshot(
&self,
session_keys: &[TransportSessionKey],
) -> TransportQualitySnapshot
pub fn transport_quality_snapshot( &self, session_keys: &[TransportSessionKey], ) -> TransportQualitySnapshot
build a transport-quality snapshot for the requested sessions
Trait Implementations§
Source§impl Debug for RtcSnapshotState
impl Debug for RtcSnapshotState
Source§impl Default for RtcSnapshotState
impl Default for RtcSnapshotState
Source§fn default() -> RtcSnapshotState
fn default() -> RtcSnapshotState
Auto Trait Implementations§
impl Freeze for RtcSnapshotState
impl RefUnwindSafe for RtcSnapshotState
impl Send for RtcSnapshotState
impl Sync for RtcSnapshotState
impl Unpin for RtcSnapshotState
impl UnsafeUnpin for RtcSnapshotState
impl UnwindSafe for RtcSnapshotState
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
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more