pub struct StreamRegistry { /* private fields */ }Expand description
Registry of active streams, keyed by topic.
Implementations§
Source§impl StreamRegistry
impl StreamRegistry
pub fn new() -> Self
Sourcepub fn register(&self, topic: String, entry: StreamEntry)
pub fn register(&self, topic: String, entry: StreamEntry)
Register a stream or event under topic.
Both planes share this one registry (#819): a point-to-point stream
(StreamEntry::stream) and a group-keyed EventService broadcast
(StreamEntry::event, #600) become topics on the same /stream
surface. The entry’s handle is the carrier subscription — for events
the full EventService-consumer→[StreamHandle] adapter (group-key
decryption over the moq_event OriginConsumer) is the marked follow-up;
this seam is kind-aware and ready to carry it (an event entry with a
None handle is an announced-but-not-yet-subscribed topic).
Sourcepub fn list_topics(&self, owner_filter: Option<&str>) -> Vec<String>
pub fn list_topics(&self, owner_filter: Option<&str>) -> Vec<String>
List active topic names (optionally filtered by owner).
Sourcepub fn remove(&self, topic: &str) -> Option<StreamEntry>
pub fn remove(&self, topic: &str) -> Option<StreamEntry>
Remove a stream and return it for cleanup.
Sourcepub fn has_carrier_handle(&self, topic: &str) -> bool
pub fn has_carrier_handle(&self, topic: &str) -> bool
Whether a topic currently holds its carrier-backed handle.
The handle is the moq carrier subscription established at open; this is
false while a data read has it checked out, or after
take_handle hands it to a bulk consumer.
Sourcepub fn take_handle(&self, topic: &str) -> Option<Box<dyn StreamHandle>>
pub fn take_handle(&self, topic: &str) -> Option<Box<dyn StreamHandle>>
Take the carrier-backed handle whole for the bulk consumption path (#819 / same handle-at-open model as #817’s mmap-for-weights).
This is the ceiling: a high-rate consumer drives the moq subscriber
directly instead of pulling frame-by-frame through Tread, so moq’s
QUIC-native delivery semantics are preserved rather than flattened into
a copy loop. Returns None if the topic is unknown or the handle is
already checked out. The entry stays registered (info/qos/ctl remain
addressable); the caller owns the subscription until it drops or
re-parks it.
Sourcepub fn kind(&self, topic: &str) -> Option<StreamKind>
pub fn kind(&self, topic: &str) -> Option<StreamKind>
The plane a topic belongs to (stream vs event), if registered.
Sourcepub fn qos(&self, topic: &str) -> Option<StreamQos>
pub fn qos(&self, topic: &str) -> Option<StreamQos>
The consumer-selected QoS for a topic, if registered.
Sourcepub fn set_qos(&self, topic: &str, qos: StreamQos) -> bool
pub fn set_qos(&self, topic: &str, qos: StreamQos) -> bool
Select QoS for a topic (the qos/ctl vocabulary write path).
Returns false if the topic is unknown.
Sourcepub fn set_resume(&self, topic: &str, seq: u64) -> bool
pub fn set_resume(&self, topic: &str, seq: u64) -> bool
Set the resume cursor for a topic (#169 seam). Returns false if
the topic is unknown.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for StreamRegistry
impl !RefUnwindSafe for StreamRegistry
impl Send for StreamRegistry
impl Sync for StreamRegistry
impl Unpin for StreamRegistry
impl UnsafeUnpin for StreamRegistry
impl !UnwindSafe for StreamRegistry
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
§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