pub struct IngestContext { /* private fields */ }Expand description
The ergonomic, cloneable handle a protocol worker uses to reach the engine
bus, handed to every InboundProtocol::serve call.
It hides the PublishRegistry trait object behind a small, stable surface:
claim a stream for publishing (open_publish), or reach
the underlying registry for advanced flows (registry).
Cloning is cheap (an Arc bump) — share it freely across per-connection tasks.
Implementations§
Source§impl IngestContext
impl IngestContext
Sourcepub fn new(registry: Arc<dyn PublishRegistry>) -> Self
pub fn new(registry: Arc<dyn PublishRegistry>) -> Self
Wrap a publish registry. The engine constructs this for you; tests and
embedders can build one directly from any PublishRegistry (e.g. an
Arc<Engine>).
Sourcepub async fn open_publish(&self, key: StreamKey) -> Result<PublishSession>
pub async fn open_publish(&self, key: StreamKey) -> Result<PublishSession>
Claim key for publishing, returning an RAII PublishSession.
Frames published through the returned session flow into the lock-free
broadcast fan-out, the keyframe-anchored GOP cache (for instant-start
replay), and the live QoS counters — exactly as a native handler’s frames
do. Fails with StreamAlreadyPublishing on a live duplicate or
PublisherLimitReached at capacity.
Sourcepub fn registry(&self) -> &Arc<dyn PublishRegistry> ⓘ
pub fn registry(&self) -> &Arc<dyn PublishRegistry> ⓘ
The underlying publish registry, for flows not covered by
open_publish.
Trait Implementations§
Source§impl Clone for IngestContext
impl Clone for IngestContext
Source§fn clone(&self) -> IngestContext
fn clone(&self) -> IngestContext
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more