pub struct Subscribe(/* private fields */);Expand description
Implementations§
Source§impl Subscribe
impl Subscribe
Sourcepub fn resource(&self) -> &str
pub fn resource(&self) -> &str
The resource name to route on (the stream id’s r= value, or the raw
stream id).
Sourcepub fn stream_id(&self) -> Option<&str>
pub fn stream_id(&self) -> Option<&str>
The raw SRT stream id, if the client supplied one.
As with a publish, an embedder can treat this as a token to authorize the viewer.
Sourcepub fn peer(&self) -> SocketAddr
pub fn peer(&self) -> SocketAddr
The remote peer address.
Sourcepub async fn accept(self, origin: &Consumer, path: impl AsPath) -> Result<()>
pub async fn accept(self, origin: &Consumer, path: impl AsPath) -> Result<()>
Accept the subscribe: resolve the broadcast at path in origin, re-mux
it to MPEG-TS, and stream it down to the caller until either side ends.
Waits for the broadcast to be announced (so a caller may connect before the publisher), cancelling cleanly if the caller disconnects first. This future resolves when playback ends, so callers usually run it on its own task.
Auto Trait Implementations§
impl !RefUnwindSafe for Subscribe
impl !UnwindSafe for Subscribe
impl Freeze for Subscribe
impl Send for Subscribe
impl Sync for Subscribe
impl Unpin for Subscribe
impl UnsafeUnpin for Subscribe
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