Skip to main content

RtcSessionState

Struct RtcSessionState 

Source
pub(super) struct RtcSessionState {
Show 14 fields pub(super) room_id: Arc<str>, pub(super) rtc: Rtc, pub(super) started_at: Instant, pub(super) rtcp_ingress_budget: RtcpIngressBudget, pub(super) defer_rtx_expiry: bool, pub(super) pending_rtp_input: Option<Ssrc>, pub(super) nack_totals: RtcNackTotals, pub(super) egress_bitrate: Arc<MediaBitrateCounter>, pub(super) local_ice_ufrag: String, pub(super) receiver_bwe_target: Option<Bitrate>, pub(super) dtls_started: bool, pub(super) packet_loop_dirty: bool, pub(super) sdp_negotiation: SessionSdpNegotiationState, pub(super) consumer_streams: ConsumerStreamStore,
}
Expand description

worker-local [str0m::Rtc] state for one transport session

this state is single-threaded under PacketLoopState control commands mutate negotiation or routing facts before the packet loop polls rtc, which keeps str0m access ordered without a per-session lock

Fields§

§room_id: Arc<str>

public room UUID used to correlate structured transport events

§rtc: Rtc

sans-I/O WebRTC engine driven only by the packet-loop worker

§started_at: Instant

creation time used for transport lifetime metrics during session teardown

§rtcp_ingress_budget: RtcpIngressBudget

candidate RTCP admission state at the pre-authentication boundary

§defer_rtx_expiry: bool

whether admitted RTCP already checked RTX age at receive time and its next output drain must poll before applying a newer clock

§pending_rtp_input: Option<Ssrc>

Wire SSRC retained across input and output polling so RTX remains distinguishable after str0m normalizes the event to its primary SSRC. https://www.rfc-editor.org/rfc/rfc4588.html#section-4

§nack_totals: RtcNackTotals

Per-MID/RID baselines that convert cumulative str0m NACK counts to deltas.

§egress_bitrate: Arc<MediaBitrateCounter>

shared writer and cold-reader handle for sent media bitrate

§local_ice_ufrag: String

local ICE fragment registered in demux recovery hints

§receiver_bwe_target: Option<Bitrate>

last desired receiver-side send bitrate for str0m BWE, retained to skip duplicate updates

§dtls_started: bool§packet_loop_dirty: bool

scheduler bit that prevents duplicate dirty-session wakeups

§sdp_negotiation: SessionSdpNegotiationState

staged SDP state owned by the worker-local offer and answer paths

§consumer_streams: ConsumerStreamStore

monotonic RTP identity state keyed by consumer transport media

this belongs to the destination session because the browser sees one local RTP stream per consumer route, independent from whichever publisher SSRC or RID currently feeds that route

Implementations§

Source§

impl RtcSessionState

Source

pub(super) fn note_repairable_transmit(&mut self, contents: &[u8], now: Instant)

Source

pub(super) fn invalidate_rtx_stream( &mut self, handle: SlotHandle<ConsumerStreamSlot>, )

Source

pub(super) fn expire_rtx_streams(&mut self, now: Instant)

Source

pub(super) fn purge_removed_rtx_streams(&mut self)

Source

pub(super) fn reset_rtx_streams(&mut self, mid: Mid)

Source

pub(super) fn remove_consumer_stream_tx(&mut self, mid: Mid)

Retires the destination StreamTx and host RTX state for one consumer MID.

Source§

impl RtcSessionState

Source

pub(super) fn prepare_rtp_input(&mut self, packet: &[u8])

Source

pub(super) fn take_rtp_repair(&mut self, primary_ssrc: Ssrc) -> bool

Source

pub(super) fn clear_ingress_context(&mut self)

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
§

impl<T> PolicyExt for T
where T: ?Sized,

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,