pub struct PublishedSourceDescriptor {
source_id: PublishedSourceId,
owner: PublishedSourceOwner,
stream_id: UserStreamId,
media_kind: MediaKind,
policy: SourcePolicy,
mid: Option<Mid>,
encodings: Vec<SourceEncodingDescriptor>,
selectable_encoding_indices: Vec<usize>,
}Expand description
Authoritative room-domain description of one published source.
The descriptor groups the stable source id, logical publishing user, caller stream id, media kind, source policy and negotiated source facts required by recording, diagnostics and transport projection. It deliberately excludes router producer state, socket state and packet-loop routing tables.
§Invariants
A descriptor must contain at least one encoding, every encoding id must be
unique and every encoding must point back to this descriptor’s source id.
Self::new validates these rules so callers do not keep a parallel
identity model by accident.
Fields§
§source_id: PublishedSourceId§owner: PublishedSourceOwner§stream_id: UserStreamId§media_kind: MediaKind§policy: SourcePolicy§mid: Option<Mid>§encodings: Vec<SourceEncodingDescriptor>§selectable_encoding_indices: Vec<usize>Implementations§
Source§impl PublishedSourceDescriptor
impl PublishedSourceDescriptor
Sourcepub fn new(
parts: PublishedSourceDescriptorParts,
) -> Result<PublishedSourceDescriptor, SourceModelError>
pub fn new( parts: PublishedSourceDescriptorParts, ) -> Result<PublishedSourceDescriptor, SourceModelError>
Builds a source descriptor after checking the source graph invariants.
Failure means the caller assembled an invalid room-domain source and should abort the surrounding publish commit before any registry state is made authoritative.
§Errors
Returns SourceModelError when the descriptor has no encodings, uses
a duplicate encoding id or contains an encoding whose source id points
elsewhere
pub const fn source_id(&self) -> PublishedSourceId
pub const fn owner(&self) -> &PublishedSourceOwner
pub const fn stream_id(&self) -> &UserStreamId
pub const fn media_kind(&self) -> MediaKind
pub const fn policy(&self) -> SourcePolicy
pub fn mid(&self) -> Option<&Mid>
pub fn encodings(&self) -> impl Iterator<Item = &SourceEncodingDescriptor>
Sourcepub fn selectable_encodings(
&self,
) -> impl Iterator<Item = &SourceEncodingDescriptor>
pub fn selectable_encodings( &self, ) -> impl Iterator<Item = &SourceEncodingDescriptor>
Returns encodings in receiver-policy rank order.
Selection is disabled unless every encoding has a RID because packet-gate
projection cannot represent the full ladder otherwise. If any maximum
bitrate is known, known values sort first in ascending order. Otherwise
known upload roles sort first from DegradedThumbnail to Featured.
Missing sort keys and ties preserve publisher order.
pub fn selectable_encoding_count(&self) -> usize
pub fn selectable_encoding_by_rank( &self, rank: usize, ) -> Option<&SourceEncodingDescriptor>
Sourcepub fn encoding(
&self,
encoding_id: SourceEncodingId,
) -> Option<&SourceEncodingDescriptor>
pub fn encoding( &self, encoding_id: SourceEncodingId, ) -> Option<&SourceEncodingDescriptor>
Returns an encoding by source-encoding identity.
Missing values are normal for best-effort callers such as diagnostics or selector resolution after a source changed. Mutation paths should treat a miss as stale work and re-read authoritative room state.
Trait Implementations§
Source§impl Clone for PublishedSourceDescriptor
impl Clone for PublishedSourceDescriptor
Source§fn clone(&self) -> PublishedSourceDescriptor
fn clone(&self) -> PublishedSourceDescriptor
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PublishedSourceDescriptor
impl Debug for PublishedSourceDescriptor
impl Eq for PublishedSourceDescriptor
impl StructuralPartialEq for PublishedSourceDescriptor
Auto Trait Implementations§
impl Freeze for PublishedSourceDescriptor
impl RefUnwindSafe for PublishedSourceDescriptor
impl Send for PublishedSourceDescriptor
impl Sync for PublishedSourceDescriptor
impl Unpin for PublishedSourceDescriptor
impl UnsafeUnpin for PublishedSourceDescriptor
impl UnwindSafe for PublishedSourceDescriptor
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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>
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>
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