pub(super) struct RouteGraph {
entries: BTreeMap<SubscriptionKey, Subscription>,
by_receiver: BTreeMap<UserId, BTreeSet<SubscriptionKey>>,
by_source: BTreeMap<PublishedSourceId, BTreeSet<SubscriptionKey>>,
relays: BTreeMap<RelayRouteKey, BTreeMap<SubscriptionKey, RelayRouteActivity>>,
next_reservation: RouteReservationId,
pending_targets: BTreeMap<UserId, VecDeque<UserId>>,
pending_target_limit: usize,
}Fields§
§entries: BTreeMap<SubscriptionKey, Subscription>§by_receiver: BTreeMap<UserId, BTreeSet<SubscriptionKey>>§by_source: BTreeMap<PublishedSourceId, BTreeSet<SubscriptionKey>>§relays: BTreeMap<RelayRouteKey, BTreeMap<SubscriptionKey, RelayRouteActivity>>§next_reservation: RouteReservationId§pending_targets: BTreeMap<UserId, VecDeque<UserId>>§pending_target_limit: usizeImplementations§
Source§impl RouteGraph
impl RouteGraph
pub(super) fn new(pending_target_limit: usize) -> Self
Sourcepub(super) fn publisher_joined(&mut self, publisher: &UserId)
pub(super) fn publisher_joined(&mut self, publisher: &UserId)
Membership promotion preserves every stream preference and frees its absent-target allowance without duplicating the logical subscriptions.
Sourcepub(super) fn publisher_left(&mut self, publisher: &UserId) -> usize
pub(super) fn publisher_left(&mut self, publisher: &UserId) -> usize
Call after detaching every source and removing this user’s receiver state. A departed member becomes the newest absent target for each receiver retaining explicit intent, even when it never published media.
fn retain_pending_target( &mut self, receiver: &UserId, publisher: &UserId, ) -> usize
pub(super) fn subscription_count(&self) -> usize
pub(super) fn count(&self) -> usize
pub(super) fn merge_intent( &mut self, key: &SubscriptionKey, update: SourceSubscriptionIntent, publisher_present: bool, ) -> usize
pub(super) fn intent(&self, key: &SubscriptionKey) -> SourceSubscriptionIntent
pub(super) fn attach_for_setup( &mut self, key: SubscriptionKey, source_id: PublishedSourceId, ) -> bool
pub(super) fn set_activity( &mut self, key: &SubscriptionKey, source_id: PublishedSourceId, connection_id: ConnectionId, active: bool, policy_pause_reason: Option<PolicyPauseReason>, ) -> Option<Vec<TransportRelayRouteEffect>>
pub(super) fn reserve_consumer_setup( &mut self, key: SubscriptionKey, source_id: PublishedSourceId, selection: ConsumerSourceSelection, ) -> Option<ConsumerRouteReservation>
pub(super) fn release_consumer_setup( &mut self, reservation: ConsumerRouteReservation, ) -> Vec<TransportRelayRouteEffect>
pub(super) fn commit( &mut self, reservation: ConsumerRouteReservation, route: TransportConsumerRoute, mid: String, selection: ConsumerSourceSelection, accept: impl FnOnce() -> Option<RoutedConsumerId>, ) -> Result<(), Vec<TransportRelayRouteEffect>>
pub(super) fn update_selection( &mut self, key: &SubscriptionKey, source_id: PublishedSourceId, route: &TransportConsumerRoute, update: impl FnOnce(&mut ConsumerSourceSelection), ) -> bool
pub(super) fn update_upgrade( &mut self, key: &SubscriptionKey, source_id: PublishedSourceId, route: &TransportConsumerRoute, pending_upgrade: Option<PendingUpgrade>, ) -> bool
pub(super) fn clear_source_upgrades(&mut self, source_id: PublishedSourceId)
pub(super) fn selection( &self, key: &SubscriptionKey, source_id: PublishedSourceId, ) -> Option<ConsumerSourceSelection>
pub(super) fn attached( &self, ) -> impl Iterator<Item = (&SubscriptionKey, &CurrentPublication)>
pub(super) fn current( &self, key: &SubscriptionKey, ) -> Option<(&SubscriptionKey, &CurrentPublication)>
pub(super) fn attached_for_receiver( &self, receiver: &UserId, ) -> impl Iterator<Item = (&SubscriptionKey, &CurrentPublication)>
pub(super) fn attached_for_source( &self, source_id: PublishedSourceId, ) -> impl Iterator<Item = (&SubscriptionKey, &CurrentPublication)>
pub(super) fn detach_source( &mut self, source_id: PublishedSourceId, ) -> RemovedRoutes
pub(super) fn reset_receiver_for_replacement( &mut self, receiver: &UserId, ) -> Vec<TransportRelayRouteEffect>
pub(super) fn remove_receiver(&mut self, receiver: &UserId) -> RemovedRoutes
pub(super) fn detach_declined_consumers( &mut self, session: &TransportSessionKey, declined: &[TransportMediaId], ) -> RemovedRoutes
pub(super) fn reserve_relay( &mut self, reservation: &ConsumerRouteReservation, target: &ConsumerSetupTarget, target_worker: MediaWorkerId, active: bool, ) -> Vec<TransportRelayRouteEffect>
pub(super) fn source_activity_target_workers<'a>( &'a self, source: &'a TransportSourceKey, ) -> impl Iterator<Item = MediaWorkerId> + 'a
fn entry(&mut self, key: SubscriptionKey) -> &mut Subscription
fn current_mut( &mut self, key: &SubscriptionKey, source_id: PublishedSourceId, ) -> Option<&mut CurrentPublication>
fn current_mut_for( &mut self, reservation: &ConsumerRouteReservation, ) -> Option<&mut CurrentPublication>
fn take_pending( &mut self, reservation: &ConsumerRouteReservation, ) -> Option<TakenPending>
fn collect_removed_realization( &mut self, key: &SubscriptionKey, realization: ConsumerRealization, removed: &mut RemovedRoutes, )
fn replace_relay( &mut self, key: &SubscriptionKey, previous: Option<RouteRelay>, relay: &RouteRelay, ) -> Vec<TransportRelayRouteEffect>
fn set_relay_owner( &mut self, key: &SubscriptionKey, relay: &RouteRelay, insert_missing: bool, ) -> Vec<TransportRelayRouteEffect>
fn release_relay( &mut self, key: &SubscriptionKey, relay: &RouteRelay, ) -> Vec<TransportRelayRouteEffect>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RouteGraph
impl RefUnwindSafe for RouteGraph
impl Send for RouteGraph
impl Sync for RouteGraph
impl Unpin for RouteGraph
impl UnsafeUnpin for RouteGraph
impl UnwindSafe for RouteGraph
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
§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>
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 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>
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