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,
}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: RouteReservationIdImplementations§
Source§impl RouteGraph
impl RouteGraph
pub(super) fn subscription_count(&self) -> usize
pub(super) fn merge_intent( &mut self, key: SubscriptionKey, update: SourceSubscriptionIntent, )
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<RelayRouteEffect>>
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<RelayRouteEffect>
pub(super) fn commit( &mut self, reservation: ConsumerRouteReservation, route: TransportConsumerRoute, mid: String, selection: ConsumerSourceSelection, accept: impl FnOnce() -> Option<RoutedConsumerId>, ) -> Result<(), Vec<RelayRouteEffect>>
pub(super) fn update_selection( &mut self, key: &SubscriptionKey, source_id: PublishedSourceId, route: &TransportConsumerRoute, update: impl FnOnce(&mut ConsumerSourceSelection), ) -> bool
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<RelayRouteEffect>
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<RelayRouteEffect>
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 next_reservation(&mut self) -> RouteReservationId
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<RelayRouteEffect>
fn set_relay_owner( &mut self, key: &SubscriptionKey, relay: &RouteRelay, insert_missing: bool, ) -> Vec<RelayRouteEffect>
fn release_relay( &mut self, key: &SubscriptionKey, relay: &RouteRelay, ) -> Vec<RelayRouteEffect>
Trait Implementations§
Source§impl Debug for RouteGraph
impl Debug for RouteGraph
Source§impl Default for RouteGraph
impl Default for RouteGraph
Source§fn default() -> RouteGraph
fn default() -> RouteGraph
Returns the “default value” for a type. Read more
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