pub trait Provider {
Show 14 methods
// Required method
fn get_provider_scopes(&self) -> MoosyncResult<Vec<ExtensionProviderScope>>;
// Provided methods
fn get_playlists(&self) -> MoosyncResult<Vec<QueryablePlaylist>> { ... }
fn get_playlist_content(
&self,
id: String,
next_page_token: Option<String>,
) -> MoosyncResult<Vec<Song>> { ... }
fn get_playlist_from_url(
&self,
url: String,
) -> MoosyncResult<Option<QueryablePlaylist>> { ... }
fn get_playback_details(
&self,
song: Song,
) -> MoosyncResult<PlaybackDetailsReturnType> { ... }
fn search(&self, term: String) -> MoosyncResult<SearchResult> { ... }
fn get_recommendations(&self) -> MoosyncResult<Vec<Song>> { ... }
fn get_song_from_url(&self, url: String) -> MoosyncResult<Option<Song>> { ... }
fn handle_custom_request(
&self,
url: String,
) -> MoosyncResult<CustomRequestReturnType> { ... }
fn get_artist_songs(
&self,
artist: QueryableArtist,
next_page_token: Option<String>,
) -> MoosyncResult<Vec<Song>> { ... }
fn get_album_songs(
&self,
album: QueryableAlbum,
next_page_token: Option<String>,
) -> MoosyncResult<Vec<Song>> { ... }
fn get_song_from_id(&self, id: String) -> MoosyncResult<Option<Song>> { ... }
fn scrobble(&self, song: Song) -> MoosyncResult<()> { ... }
fn get_lyrics(&self, song: Song) -> MoosyncResult<String> { ... }
}
Expand description
Trait for handling provider-related events.
Required Methods§
Sourcefn get_provider_scopes(&self) -> MoosyncResult<Vec<ExtensionProviderScope>>
fn get_provider_scopes(&self) -> MoosyncResult<Vec<ExtensionProviderScope>>
Called when the main app requests the provider scopes.
Provided Methods§
Sourcefn get_playlists(&self) -> MoosyncResult<Vec<QueryablePlaylist>>
fn get_playlists(&self) -> MoosyncResult<Vec<QueryablePlaylist>>
Called when the main app requests the list of playlists.
Sourcefn get_playlist_content(
&self,
id: String,
next_page_token: Option<String>,
) -> MoosyncResult<Vec<Song>>
fn get_playlist_content( &self, id: String, next_page_token: Option<String>, ) -> MoosyncResult<Vec<Song>>
Called when the main app requests the content of a specific playlist.
Sourcefn get_playlist_from_url(
&self,
url: String,
) -> MoosyncResult<Option<QueryablePlaylist>>
fn get_playlist_from_url( &self, url: String, ) -> MoosyncResult<Option<QueryablePlaylist>>
Called when the main app requests a playlist from a URL.
Sourcefn get_playback_details(
&self,
song: Song,
) -> MoosyncResult<PlaybackDetailsReturnType>
fn get_playback_details( &self, song: Song, ) -> MoosyncResult<PlaybackDetailsReturnType>
Called when the main app requests playback details for a song.
Sourcefn search(&self, term: String) -> MoosyncResult<SearchResult>
fn search(&self, term: String) -> MoosyncResult<SearchResult>
Called when the main app performs a search.
Sourcefn get_recommendations(&self) -> MoosyncResult<Vec<Song>>
fn get_recommendations(&self) -> MoosyncResult<Vec<Song>>
Called when the main app requests recommendations.
Sourcefn get_song_from_url(&self, url: String) -> MoosyncResult<Option<Song>>
fn get_song_from_url(&self, url: String) -> MoosyncResult<Option<Song>>
Called when the main app requests a song from a URL.
Sourcefn handle_custom_request(
&self,
url: String,
) -> MoosyncResult<CustomRequestReturnType>
fn handle_custom_request( &self, url: String, ) -> MoosyncResult<CustomRequestReturnType>
Called when the main app handles a custom request.
Sourcefn get_artist_songs(
&self,
artist: QueryableArtist,
next_page_token: Option<String>,
) -> MoosyncResult<Vec<Song>>
fn get_artist_songs( &self, artist: QueryableArtist, next_page_token: Option<String>, ) -> MoosyncResult<Vec<Song>>
Called when the main app requests songs of a specific artist.
Sourcefn get_album_songs(
&self,
album: QueryableAlbum,
next_page_token: Option<String>,
) -> MoosyncResult<Vec<Song>>
fn get_album_songs( &self, album: QueryableAlbum, next_page_token: Option<String>, ) -> MoosyncResult<Vec<Song>>
Called when the main app requests songs of a specific album.
Sourcefn get_song_from_id(&self, id: String) -> MoosyncResult<Option<Song>>
fn get_song_from_id(&self, id: String) -> MoosyncResult<Option<Song>>
Called when the main app requests a song from an ID.
Sourcefn scrobble(&self, song: Song) -> MoosyncResult<()>
fn scrobble(&self, song: Song) -> MoosyncResult<()>
Called when the main app requests to scrobble a song.
Sourcefn get_lyrics(&self, song: Song) -> MoosyncResult<String>
fn get_lyrics(&self, song: Song) -> MoosyncResult<String>
Called when the main app requests lyrics for a song.