Skip to main content

Playable

Trait Playable 

Source
pub trait Playable: Send + Sync {
    // Required method
    fn open<'life0, 'life1, 'async_trait>(
        &'life0 self,
        track: &'life1 Track,
        start_ms: i64,
    ) -> Pin<Box<dyn Future<Output = Result<Stream, Failure>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided methods
    fn seekable(&self) -> bool { ... }
    fn warm<'life0, 'life1, 'async_trait>(
        &'life0 self,
        _track: &'life1 Track,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
}
Expand description

A source that can stream audio.

Required Methods§

Source

fn open<'life0, 'life1, 'async_trait>( &'life0 self, track: &'life1 Track, start_ms: i64, ) -> Pin<Box<dyn Future<Output = Result<Stream, Failure>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Open track, ideally starting at start_ms (see Stream::start_sample).

Provided Methods§

Source

fn seekable(&self) -> bool

Whether open honours start_ms without downloading from the start.

Source

fn warm<'life0, 'life1, 'async_trait>( &'life0 self, _track: &'life1 Track, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Hint that track will probably play soon (resolve URLs, warm caches).

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§