Skip to main content

SubscriptionExt

Trait SubscriptionExt 

Source
pub trait SubscriptionExt: Sealed {
    // Required method
    fn remote_broadcast(&self) -> RemoteBroadcast;
}
Expand description

Reads a Subscription as media.

The trait is sealed: only Subscription implements it.

§Examples

use iroh_live::{
    BroadcastTicket, Node,
    media::{PlayerConfig, SubscriptionExt},
};

let subscription = node.subscribe_ticket(&ticket).await?;
let player = subscription.remote_broadcast().play(PlayerConfig::default())?;

Required Methods§

Source

fn remote_broadcast(&self) -> RemoteBroadcast

Returns the media of this subscription.

The broadcast follows the subscription’s path through the route table it was resolved in, so a change of route does not end it, and its players adapt to the link that serves it. A subscription on one session re-resolves through that session only. The catalog arrives later: watch RemoteBroadcast::catalog for it.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§