Skip to main content

RemoteAddrDemux

Struct RemoteAddrDemux 

Source
pub struct RemoteAddrDemux {
    remote_addr_index: HashMap<SocketAddr, TransportSessionKey>,
    remote_addrs_by_session: BTreeMap<TransportSessionKey, Vec<SocketAddr>>,
    local_ice_ufrag_index: HashMap<String, TransportSessionKey>,
    local_ice_ufrag_by_session: BTreeMap<TransportSessionKey, String>,
    remote_candidate_addr_index: HashMap<SocketAddr, Vec<TransportSessionKey>>,
    remote_candidate_addrs_by_session: BTreeMap<TransportSessionKey, Vec<SocketAddr>>,
}
Expand description

Bidirectional demux indexes for worker-local UDP ingress recovery.

Fields§

§remote_addr_index: HashMap<SocketAddr, TransportSessionKey>

learned UDP source tuple to session pin

§remote_addrs_by_session: BTreeMap<TransportSessionKey, Vec<SocketAddr>>

reverse lookup for learned UDP source tuple cleanup

§local_ice_ufrag_index: HashMap<String, TransportSessionKey>

local ICE ufrag to session recovery hint

§local_ice_ufrag_by_session: BTreeMap<TransportSessionKey, String>

reverse lookup for replacing or removing a session local ICE ufrag

§remote_candidate_addr_index: HashMap<SocketAddr, Vec<TransportSessionKey>>

signaled remote candidate address to possible sessions

§remote_candidate_addrs_by_session: BTreeMap<TransportSessionKey, Vec<SocketAddr>>

reverse lookup for candidate hint cleanup after renegotiation or teardown

Implementations§

Source§

impl RemoteAddrDemux

Source

pub fn session_key_for_remote_addr( &self, source_addr: SocketAddr, ) -> Option<&TransportSessionKey>

returns the session currently pinned to a UDP source tuple

this is a hot-path hint for cached ingress routing callers must still re-check the packet with Rtc::accepts() before feeding it into a session because ICE state can move after the pin was learned

Source

pub fn remember_remote_addr( &mut self, source_addr: SocketAddr, session_key: &TransportSessionKey, ) -> bool

pins a UDP source tuple to the session that just accepted traffic

returns true when the visible mapping changed remapping a tuple also removes it from the previous session reverse index so session teardown can later clean every learned tuple with one key

Source

pub(super) fn session_for_local_ufrag( &self, local_ice_ufrag: &str, ) -> Option<&TransportSessionKey>

returns the session advertised by a local ICE ufrag

this index is used to narrow STUN recovery when the USERNAME attribute names the local fragment the returned session is still only a candidate for Rtc::accepts()

Source

pub(super) fn remember_local_ice_ufrag( &mut self, local_ice_ufrag: &str, session_key: &TransportSessionKey, ) -> bool

replaces the local ICE ufrag registered for a session

each session owns at most one local ufrag each local ufrag maps to at most one session returning false means the existing mapping already expressed that contract

Source

pub fn candidates_for_src_addr( &self, source_addr: SocketAddr, ) -> Option<&[TransportSessionKey]>

Returns sessions whose signaled candidates match the observed source.

Candidate addresses are weaker than learned source pins because every session advertising the address remains a candidate. Rtc::accepts() remains the ownership authority.

Source

pub fn replace_remote_candidates<I>( &mut self, session_key: &TransportSessionKey, candidate_addrs: I, )
where I: IntoIterator<Item = SocketAddr>,

replaces all signaled remote candidate addresses for one session

this is called after answer application when str0m has updated the candidate set old hints are removed first so recovery cannot keep probing a session through candidates that no longer belong to it

Source

pub(super) fn forget_remote_addr(&mut self, source_addr: SocketAddr)

removes one learned UDP source tuple pin after cached Rtc::accepts() rejection

Source

pub(super) fn forget_user_remote_addrs( &mut self, session_key: &TransportSessionKey, )

removes every learned UDP source tuple when its session is removed

Source

pub(super) fn forget_user_local_ice_ufrag( &mut self, session_key: &TransportSessionKey, )

removes the local ICE ufrag recovery hint for a session

Source

pub(super) fn forget_user_remote_candidates( &mut self, session_key: &TransportSessionKey, )

removes all remote candidate recovery hints owned by a session

candidate address indexes can contain several sessions for one address cleanup removes only the target session from each fanout list and drops empty address entries afterward

Source

fn remove_remote_addr( &mut self, session_key: &TransportSessionKey, source_addr: SocketAddr, )

Trait Implementations§

Source§

impl Debug for RemoteAddrDemux

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for RemoteAddrDemux

Source§

fn default() -> RemoteAddrDemux

Returns the “default value” for a type. Read more

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<T> CryptoSafe for T
where T: Send + Sync + Debug,

§

impl<T> CryptoSafe for T

§

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

§

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