pub struct Session { /* private fields */ }
Expand description
A MoqTransfork 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(session: Session) -> Result<Self, Error>
pub async fn connect(session: Session) -> Result<Self, Error>
Perform the MoQ handshake as a client.
Sourcepub async fn accept(session: Session) -> Result<Self, Error>
pub async fn accept(session: Session) -> Result<Self, Error>
Perform the MoQ handshake as a server
Sourcepub fn publish(&mut self, track: TrackConsumer) -> Result<(), Error>
pub fn publish(&mut self, track: TrackConsumer) -> Result<(), Error>
Publish a track, automatically announcing and serving it.
Sourcepub fn announce(&mut self, announced: AnnouncedConsumer)
pub fn announce(&mut self, announced: AnnouncedConsumer)
Optionally announce the provided tracks. This is advanced functionality if you wish to perform dynamic track generation in conjunction with Self::route.
Sourcepub fn route(&mut self, router: RouterConsumer)
pub fn route(&mut self, router: RouterConsumer)
Optionally route unknown paths. This is advanced functionality if you wish to perform dynamic track generation in conjunction with Self::announce.
Sourcepub fn subscribe(&self, track: Track) -> TrackConsumer
pub fn subscribe(&self, track: Track) -> TrackConsumer
Subscribe to a track and start receiving data over the network.
Sourcepub fn announced(&self) -> AnnouncedConsumer
pub fn announced(&self) -> AnnouncedConsumer
Discover any tracks published by the remote.
Sourcepub fn announced_prefix(&self, prefix: Path) -> AnnouncedConsumer
pub fn announced_prefix(&self, prefix: Path) -> AnnouncedConsumer
Discover any tracks published by the remote matching a prefix.