Skip to main content

StreamProvider

Trait StreamProvider 

Source
pub trait StreamProvider: Send + Sync {
    // Required methods
    fn name(&self) -> &'static str;
    fn matches(&self, url: &str) -> bool;
    fn get_stream_info<'life0, 'life1, 'async_trait>(
        &'life0 self,
        id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<StreamInfo>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn list_series<'life0, 'life1, 'async_trait>(
        &'life0 self,
        series_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<SeriesInfo>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided method
    fn search<'life0, 'life1, 'async_trait>(
        &'life0 self,
        query: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<EpisodeInfo>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}
Expand description

Trait for streaming service providers.

Implementors extract stream metadata from service-specific APIs and return normalized StreamInfo / SeriesInfo that the backends can consume.

Required Methods§

Source

fn name(&self) -> &'static str

Short lowercase provider name (e.g., "yle", "svt", "generic").

Source

fn matches(&self, url: &str) -> bool

Returns true if this provider can handle the given URL.

Source

fn get_stream_info<'life0, 'life1, 'async_trait>( &'life0 self, id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<StreamInfo>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Fetch stream metadata for a program/video identified by id.

Source

fn list_series<'life0, 'life1, 'async_trait>( &'life0 self, series_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<SeriesInfo>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

List all episodes in a series or playlist.

Provided Methods§

Source

fn search<'life0, 'life1, 'async_trait>( &'life0 self, query: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<EpisodeInfo>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Search the provider’s catalog. Returns an empty vec by default.

Implementors§