pub trait MusicSource: Send + Sync {
// Required methods
fn platform(&self) -> Source;
fn supported_qualities(&self) -> &[Quality];
fn search<'life0, 'life1, 'async_trait>(
&'life0 self,
keyword: &'life1 str,
page: usize,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<SearchResult, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_url<'life0, 'life1, 'async_trait>(
&'life0 self,
song_id: &'life1 str,
quality: Quality,
) -> Pin<Box<dyn Future<Output = Result<String, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_lyric<'life0, 'life1, 'async_trait>(
&'life0 self,
song_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<LyricInfo>, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn get_pic<'life0, 'life1, 'async_trait>(
&'life0 self,
song_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, SourceError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Required Methods§
fn platform(&self) -> Source
fn supported_qualities(&self) -> &[Quality]
fn search<'life0, 'life1, 'async_trait>(
&'life0 self,
keyword: &'life1 str,
page: usize,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<SearchResult, SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_url<'life0, 'life1, 'async_trait>(
&'life0 self,
song_id: &'life1 str,
quality: Quality,
) -> Pin<Box<dyn Future<Output = Result<String, SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_lyric<'life0, 'life1, 'async_trait>(
&'life0 self,
song_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<LyricInfo>, SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_pic<'life0, 'life1, 'async_trait>(
&'life0 self,
song_id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, SourceError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".