pub struct Session { /* private fields */ }Expand description
A MoQ session, used to publish and/or subscribe to broadcasts.
A publisher will Self::publish tracks, or alternatively [Self::announce] and [Self::route] arbitrary paths. A subscriber will [Self::subscribe] to tracks, or alternatively use [Self::announced] to discover arbitrary paths.
Implementations§
Source§impl Session
impl Session
Sourcepub async fn connect<T: Into<Session>>(session: T) -> Result<Self, Error>
pub async fn connect<T: Into<Session>>(session: T) -> Result<Self, Error>
Perform the MoQ handshake as a client.
Sourcepub async fn accept<T: Into<Session>>(session: T) -> Result<Self, Error>
pub async fn accept<T: Into<Session>>(session: T) -> Result<Self, Error>
Perform the MoQ handshake as a server
Sourcepub fn publish<T: ToString>(&mut self, path: T, broadcast: BroadcastConsumer)
pub fn publish<T: ToString>(&mut self, path: T, broadcast: BroadcastConsumer)
Publish a broadcast, automatically announcing and serving it.
Sourcepub fn publish_prefix(&mut self, prefix: &str, broadcasts: OriginConsumer)
pub fn publish_prefix(&mut self, prefix: &str, broadcasts: OriginConsumer)
Publish all broadcasts from the given origin with a prefix.
Sourcepub fn publish_all(&mut self, broadcasts: OriginConsumer)
pub fn publish_all(&mut self, broadcasts: OriginConsumer)
Publish all broadcasts from the given origin.
Sourcepub fn consume(&self, path: &str) -> BroadcastConsumer
pub fn consume(&self, path: &str) -> BroadcastConsumer
Consume a broadcast, returning a handle that can request tracks.
No tracks flow over the network until BroadcastConsumer::subscribe is called.
Sourcepub fn consume_all(&self) -> OriginConsumer
pub fn consume_all(&self) -> OriginConsumer
Discover and consume all broadcasts.
No tracks flow over the network until BroadcastConsumer::subscribe is called.
Sourcepub fn consume_prefix<S: ToString>(&self, prefix: S) -> OriginConsumer
pub fn consume_prefix<S: ToString>(&self, prefix: S) -> OriginConsumer
Discover and consume any broadcasts published by the remote matching a prefix.
No tracks flow over the network until BroadcastConsumer::subscribe is called.
Sourcepub fn consume_exact(&self, path: &str) -> OriginConsumer
pub fn consume_exact(&self, path: &str) -> OriginConsumer
Discover and consume a specific broadcast.
This is different from consume because it waits for an announcement.
The returned OriginConsumer will ONLY announce a suffix=“”.
TODO: Make a special class for this.