pub struct PublishSession { /* private fields */ }Expand description
An RAII publish session — a protocol worker’s exclusive token for one live stream.
Wraps the engine’s StreamHandle: every publish_frame
lands in the broadcast fan-out, GOP cache, and live QoS counters. Dropping the
session releases the publish slot (best-effort, on the current Tokio runtime),
so a worker that returns early or panics never leaks a stream. Prefer
finish for deterministic, awaited teardown.
Implementations§
Source§impl PublishSession
impl PublishSession
Sourcepub fn handle(&self) -> &StreamHandle
pub fn handle(&self) -> &StreamHandle
The underlying engine StreamHandle — GOP cache, QoS, subscriber count,
metadata, and direct subscribe/replay access.
Sourcepub fn publish_frame(&self, frame: MediaFrame) -> Result<usize>
pub fn publish_frame(&self, frame: MediaFrame) -> Result<usize>
Publish one decoded frame to all subscribers; returns the live subscriber
count (0 when nobody is watching yet).
Trait Implementations§
Source§impl Drop for PublishSession
impl Drop for PublishSession
Auto Trait Implementations§
impl !RefUnwindSafe for PublishSession
impl !UnwindSafe for PublishSession
impl Freeze for PublishSession
impl Send for PublishSession
impl Sync for PublishSession
impl Unpin for PublishSession
impl UnsafeUnpin for PublishSession
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