Skip to main content

RouteGraph

Struct RouteGraph 

Source
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: RouteReservationId

Implementations§

Source§

impl RouteGraph

Source

pub(super) fn subscription_count(&self) -> usize

Source

pub(super) fn merge_intent( &mut self, key: SubscriptionKey, update: SourceSubscriptionIntent, )

Source

pub(super) fn intent(&self, key: &SubscriptionKey) -> SourceSubscriptionIntent

Source

pub(super) fn attach_for_setup( &mut self, key: SubscriptionKey, source_id: PublishedSourceId, ) -> bool

Source

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

Source

pub(super) fn reserve_consumer_setup( &mut self, key: SubscriptionKey, source_id: PublishedSourceId, selection: ConsumerSourceSelection, ) -> Option<ConsumerRouteReservation>

Source

pub(super) fn release_consumer_setup( &mut self, reservation: ConsumerRouteReservation, ) -> Vec<RelayRouteEffect>

Source

pub(super) fn commit( &mut self, reservation: ConsumerRouteReservation, route: TransportConsumerRoute, mid: String, selection: ConsumerSourceSelection, accept: impl FnOnce() -> Option<RoutedConsumerId>, ) -> Result<(), Vec<RelayRouteEffect>>

Source

pub(super) fn update_selection( &mut self, key: &SubscriptionKey, source_id: PublishedSourceId, route: &TransportConsumerRoute, update: impl FnOnce(&mut ConsumerSourceSelection), ) -> bool

Source

pub(super) fn selection( &self, key: &SubscriptionKey, source_id: PublishedSourceId, ) -> Option<ConsumerSourceSelection>

Source

pub(super) fn attached( &self, ) -> impl Iterator<Item = (&SubscriptionKey, &CurrentPublication)>

Source

pub(super) fn current( &self, key: &SubscriptionKey, ) -> Option<(&SubscriptionKey, &CurrentPublication)>

Source

pub(super) fn attached_for_receiver( &self, receiver: &UserId, ) -> impl Iterator<Item = (&SubscriptionKey, &CurrentPublication)>

Source

pub(super) fn attached_for_source( &self, source_id: PublishedSourceId, ) -> impl Iterator<Item = (&SubscriptionKey, &CurrentPublication)>

Source

pub(super) fn detach_source( &mut self, source_id: PublishedSourceId, ) -> RemovedRoutes

Source

pub(super) fn reset_receiver_for_replacement( &mut self, receiver: &UserId, ) -> Vec<RelayRouteEffect>

Source

pub(super) fn remove_receiver(&mut self, receiver: &UserId) -> RemovedRoutes

Source

pub(super) fn detach_declined_consumers( &mut self, session: &TransportSessionKey, declined: &[TransportMediaId], ) -> RemovedRoutes

Source

pub(super) fn reserve_relay( &mut self, reservation: &ConsumerRouteReservation, target: &ConsumerSetupTarget, target_worker: MediaWorkerId, active: bool, ) -> Vec<RelayRouteEffect>

Source

pub(super) fn source_activity_target_workers<'a>( &'a self, source: &'a TransportSourceKey, ) -> impl Iterator<Item = MediaWorkerId> + 'a

Source

fn entry(&mut self, key: SubscriptionKey) -> &mut Subscription

Source

fn next_reservation(&mut self) -> RouteReservationId

Source

fn current_mut( &mut self, key: &SubscriptionKey, source_id: PublishedSourceId, ) -> Option<&mut CurrentPublication>

Source

fn current_mut_for( &mut self, reservation: &ConsumerRouteReservation, ) -> Option<&mut CurrentPublication>

Source

fn take_pending( &mut self, reservation: &ConsumerRouteReservation, ) -> Option<TakenPending>

Source

fn collect_removed_realization( &mut self, key: &SubscriptionKey, realization: ConsumerRealization, removed: &mut RemovedRoutes, )

Source

fn replace_relay( &mut self, key: &SubscriptionKey, previous: Option<RouteRelay>, relay: &RouteRelay, ) -> Vec<RelayRouteEffect>

Source

fn set_relay_owner( &mut self, key: &SubscriptionKey, relay: &RouteRelay, insert_missing: bool, ) -> Vec<RelayRouteEffect>

Source

fn release_relay( &mut self, key: &SubscriptionKey, relay: &RouteRelay, ) -> Vec<RelayRouteEffect>

Trait Implementations§

Source§

impl Debug for RouteGraph

Source§

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

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

impl Default for RouteGraph

Source§

fn default() -> RouteGraph

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,