pub struct AuthCodeSpotify {
    pub creds: Credentials,
    pub oauth: OAuth,
    pub config: Config,
    pub token: Arc<Mutex<Option<Token>>>,
    /* private fields */
}
Expand description

The Authorization Code Flow client for the Spotify API.

This includes user authorization, and thus has access to endpoints related to user private data, unlike the Client Credentials Flow client. See BaseClient and OAuthClient for the available endpoints.

If you’re developing a CLI application, you might be interested in the cli feature. This brings the prompt_for_token method to automatically follow the flow steps via user interaction.

Otherwise, these are the steps to be followed to authenticate your app:

  1. Generate a request URL with Self::get_authorize_url.

  2. The user logs in with the request URL. They will be redirected to the given redirect URI, including a code in the URL parameters. This happens on your side.

  3. The code obtained in the previous step is parsed with Self::parse_response_code.

  4. The code is sent to Spotify in order to obtain an access token with Self::request_token.

  5. Finally, this access token can be used internally for the requests. It may expire relatively soon, so it can be refreshed with the refresh token (obtained in the previous step as well) using Self::refresh_token. Otherwise, a new access token may be generated from scratch by repeating these steps, but the advantage of refreshing it is that this doesn’t require the user to log in, and that it’s a simpler procedure.

    See this related example to learn more about refreshing tokens.

There’s a webapp example for more details on how you can implement it for something like a web server, or this one for a CLI use case.

An example of the CLI authentication:

demo

Note: even if your script does not have an accessible URL, you will have to specify a redirect URI. It doesn’t need to work, you can use http://localhost:8888/callback for example, which will also have the code appended like so: http://localhost/?code=....

Fields§

§creds: Credentials§oauth: OAuth§config: Config§token: Arc<Mutex<Option<Token>>>

Implementations§

source§

impl AuthCodeSpotify

source

pub fn new(creds: Credentials, oauth: OAuth) -> Self

Builds a new AuthCodeSpotify given a pair of client credentials and OAuth information.

source

pub fn from_token(token: Token) -> Self

Build a new AuthCodeSpotify from an already generated token. Note that once the token expires this will fail to make requests, as the client credentials aren’t known.

source

pub fn with_config(creds: Credentials, oauth: OAuth, config: Config) -> Self

Same as Self::new but with an extra parameter to configure the client.

source

pub fn from_token_with_config( token: Token, creds: Credentials, oauth: OAuth, config: Config ) -> Self

Build a new AuthCodeSpotify from an already generated token and config. Use this to be able to refresh a token.

source

pub fn get_authorize_url(&self, show_dialog: bool) -> ClientResult<String>

Returns the URL needed to authorize the current client as the first step in the authorization flow.

Trait Implementations§

source§

impl BaseClient for AuthCodeSpotify

This client has access to the base methods.

source§

fn refetch_token(&self) -> ClientResult<Option<Token>>

Refetch the current access token given a refresh token. May return None if there’s no access/refresh token.

source§

fn get_http(&self) -> &HttpClient

source§

fn get_token(&self) -> Arc<Mutex<Option<Token>>>

Note that the token is wrapped by a Mutex in order to allow interior mutability. This is required so that the entire client doesn’t have to be mutable (the token is accessed to from every endpoint).
source§

fn get_creds(&self) -> &Credentials

source§

fn get_config(&self) -> &Config

source§

fn api_url(&self, url: &str) -> String

Returns the absolute URL for an endpoint in the API.
source§

fn auth_url(&self, url: &str) -> String

Returns the absolute URL for an authentication step in the API.
source§

fn auto_reauth(&self) -> ClientResult<()>

Re-authenticate the client automatically if it’s configured to do so, which uses the refresh token to obtain a new access token.
source§

fn refresh_token(&self) -> ClientResult<()>

Refreshes the current access token given a refresh token. The obtained token will be saved internally.
source§

fn write_token_cache(&self) -> ClientResult<()>

Updates the cache file at the internal cache path. Read more
source§

fn fetch_access_token( &self, payload: &Form<'_>, headers: Option<&Headers> ) -> ClientResult<Token>

Sends a request to Spotify for an access token.
source§

fn track( &self, track_id: TrackId<'_>, market: Option<Market> ) -> ClientResult<FullTrack>

Returns a single track given the track’s ID, URI or URL. Read more
source§

fn tracks<'a>( &self, track_ids: impl IntoIterator<Item = TrackId<'a>> + Send + 'a, market: Option<Market> ) -> ClientResult<Vec<FullTrack>>

Returns a list of tracks given a list of track IDs, URIs, or URLs. Read more
source§

fn artist(&self, artist_id: ArtistId<'_>) -> ClientResult<FullArtist>

Returns a single artist given the artist’s ID, URI or URL. Read more
source§

fn artists<'a>( &self, artist_ids: impl IntoIterator<Item = ArtistId<'a>> + Send + 'a ) -> ClientResult<Vec<FullArtist>>

Returns a list of artists given the artist IDs, URIs, or URLs. Read more
source§

fn artist_albums<'a>( &'a self, artist_id: ArtistId<'a>, include_groups: impl IntoIterator<Item = AlbumType> + Send + Copy + 'a, market: Option<Market> ) -> Paginator<'_, ClientResult<SimplifiedAlbum>>

Get Spotify catalog information about an artist’s albums. Read more
source§

fn artist_albums_manual<'a>( &self, artist_id: ArtistId<'_>, include_groups: impl IntoIterator<Item = AlbumType> + Send + 'a, market: Option<Market>, limit: Option<u32>, offset: Option<u32> ) -> ClientResult<Page<SimplifiedAlbum>>

The manually paginated version of Self::artist_albums.
source§

fn artist_top_tracks( &self, artist_id: ArtistId<'_>, market: Option<Market> ) -> ClientResult<Vec<FullTrack>>

Get Spotify catalog information about an artist’s top 10 tracks by country. Read more
Get Spotify catalog information about artists similar to an identified artist. Similarity is based on analysis of the Spotify community’s listening history. Read more
source§

fn album( &self, album_id: AlbumId<'_>, market: Option<Market> ) -> ClientResult<FullAlbum>

Returns a single album given the album’s ID, URIs or URL. Read more
source§

fn albums<'a>( &self, album_ids: impl IntoIterator<Item = AlbumId<'a>> + Send + 'a, market: Option<Market> ) -> ClientResult<Vec<FullAlbum>>

Returns a list of albums given the album IDs, URIs, or URLs. Read more
source§

fn search( &self, q: &str, _type: SearchType, market: Option<Market>, include_external: Option<IncludeExternal>, limit: Option<u32>, offset: Option<u32> ) -> ClientResult<SearchResult>

Search for an Item. Get Spotify catalog information about artists, albums, tracks or playlists that match a keyword string. Read more
source§

fn album_track<'a>( &'a self, album_id: AlbumId<'a>, market: Option<Market> ) -> Paginator<'_, ClientResult<SimplifiedTrack>>

Get Spotify catalog information about an album’s tracks. Read more
source§

fn album_track_manual( &self, album_id: AlbumId<'_>, market: Option<Market>, limit: Option<u32>, offset: Option<u32> ) -> ClientResult<Page<SimplifiedTrack>>

The manually paginated version of Self::album_track.
source§

fn user(&self, user_id: UserId<'_>) -> ClientResult<PublicUser>

Gets basic profile information about a Spotify User. Read more
source§

fn playlist( &self, playlist_id: PlaylistId<'_>, fields: Option<&str>, market: Option<Market> ) -> ClientResult<FullPlaylist>

Get full details about Spotify playlist. Read more
source§

fn user_playlist( &self, user_id: UserId<'_>, playlist_id: Option<PlaylistId<'_>>, fields: Option<&str> ) -> ClientResult<FullPlaylist>

Gets playlist of a user. Read more
source§

fn playlist_check_follow( &self, playlist_id: PlaylistId<'_>, user_ids: &[UserId<'_>] ) -> ClientResult<Vec<bool>>

Check to see if the given users are following the given playlist. Read more
source§

fn get_a_show( &self, id: ShowId<'_>, market: Option<Market> ) -> ClientResult<FullShow>

Get Spotify catalog information for a single show identified by its unique Spotify ID. Read more
source§

fn get_several_shows<'a>( &self, ids: impl IntoIterator<Item = ShowId<'a>> + Send + 'a, market: Option<Market> ) -> ClientResult<Vec<SimplifiedShow>>

Get Spotify catalog information for multiple shows based on their Spotify IDs. Read more
source§

fn get_shows_episodes<'a>( &'a self, id: ShowId<'a>, market: Option<Market> ) -> Paginator<'_, ClientResult<SimplifiedEpisode>>

Get Spotify catalog information about an show’s episodes. Optional parameters can be used to limit the number of episodes returned. Read more
source§

fn get_shows_episodes_manual( &self, id: ShowId<'_>, market: Option<Market>, limit: Option<u32>, offset: Option<u32> ) -> ClientResult<Page<SimplifiedEpisode>>

The manually paginated version of Self::get_shows_episodes.
source§

fn get_an_episode( &self, id: EpisodeId<'_>, market: Option<Market> ) -> ClientResult<FullEpisode>

Get Spotify catalog information for a single episode identified by its unique Spotify ID. Read more
source§

fn get_several_episodes<'a>( &self, ids: impl IntoIterator<Item = EpisodeId<'a>> + Send + 'a, market: Option<Market> ) -> ClientResult<Vec<FullEpisode>>

Get Spotify catalog information for multiple episodes based on their Spotify IDs. Read more
source§

fn track_features(&self, track_id: TrackId<'_>) -> ClientResult<AudioFeatures>

Get audio features for a track Read more
source§

fn tracks_features<'a>( &self, track_ids: impl IntoIterator<Item = TrackId<'a>> + Send + 'a ) -> ClientResult<Option<Vec<AudioFeatures>>>

Get Audio Features for Several Tracks Read more
source§

fn track_analysis(&self, track_id: TrackId<'_>) -> ClientResult<AudioAnalysis>

Get Audio Analysis for a Track Read more
source§

fn categories<'a>( &'a self, locale: Option<&'a str>, country: Option<Market> ) -> Paginator<'_, ClientResult<Category>>

Get a list of new album releases featured in Spotify Read more
source§

fn categories_manual( &self, locale: Option<&str>, country: Option<Market>, limit: Option<u32>, offset: Option<u32> ) -> ClientResult<Page<Category>>

The manually paginated version of Self::categories.
source§

fn category_playlists<'a>( &'a self, category_id: &'a str, country: Option<Market> ) -> Paginator<'_, ClientResult<SimplifiedPlaylist>>

Get a list of playlists in a category in Spotify Read more
source§

fn category_playlists_manual( &self, category_id: &str, country: Option<Market>, limit: Option<u32>, offset: Option<u32> ) -> ClientResult<Page<SimplifiedPlaylist>>

The manually paginated version of Self::category_playlists.
source§

fn featured_playlists( &self, locale: Option<&str>, country: Option<Market>, timestamp: Option<DateTime<Utc>>, limit: Option<u32>, offset: Option<u32> ) -> ClientResult<FeaturedPlaylists>

Get a list of Spotify featured playlists. Read more
source§

fn new_releases( &self, country: Option<Market> ) -> Paginator<'_, ClientResult<SimplifiedAlbum>>

Get a list of new album releases featured in Spotify. Read more
source§

fn new_releases_manual( &self, country: Option<Market>, limit: Option<u32>, offset: Option<u32> ) -> ClientResult<Page<SimplifiedAlbum>>

The manually paginated version of Self::new_releases.
source§

fn recommendations<'a>( &self, attributes: impl IntoIterator<Item = RecommendationsAttribute> + Send + 'a, seed_artists: Option<impl IntoIterator<Item = ArtistId<'a>> + Send + 'a>, seed_genres: Option<impl IntoIterator<Item = &'a str> + Send + 'a>, seed_tracks: Option<impl IntoIterator<Item = TrackId<'a>> + Send + 'a>, market: Option<Market>, limit: Option<u32> ) -> ClientResult<Recommendations>

Get Recommendations Based on Seeds Read more
source§

fn playlist_items<'a>( &'a self, playlist_id: PlaylistId<'a>, fields: Option<&'a str>, market: Option<Market> ) -> Paginator<'_, ClientResult<PlaylistItem>>

Get full details of the items of a playlist owned by a user. Read more
source§

fn playlist_items_manual( &self, playlist_id: PlaylistId<'_>, fields: Option<&str>, market: Option<Market>, limit: Option<u32>, offset: Option<u32> ) -> ClientResult<Page<PlaylistItem>>

The manually paginated version of Self::playlist_items.
source§

fn user_playlists<'a>( &'a self, user_id: UserId<'a> ) -> Paginator<'_, ClientResult<SimplifiedPlaylist>>

Gets playlists of a user. Read more
source§

fn user_playlists_manual( &self, user_id: UserId<'_>, limit: Option<u32>, offset: Option<u32> ) -> ClientResult<Page<SimplifiedPlaylist>>

The manually paginated version of Self::user_playlists.
source§

impl Clone for AuthCodeSpotify

source§

fn clone(&self) -> AuthCodeSpotify

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for AuthCodeSpotify

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for AuthCodeSpotify

source§

fn default() -> AuthCodeSpotify

Returns the “default value” for a type. Read more
source§

impl OAuthClient for AuthCodeSpotify

This client includes user authorization, so it has access to the user private endpoints in OAuthClient.

source§

fn request_token(&self, code: &str) -> ClientResult<()>

Obtains a user access token given a code, as part of the OAuth authentication. The access token will be saved internally.

source§

fn get_oauth(&self) -> &OAuth

source§

fn read_token_cache(&self, allow_expired: bool) -> ClientResult<Option<Token>>

Tries to read the cache file’s token. Read more
source§

fn parse_response_code(&self, url: &str) -> Option<String>

Parse the response code in the given response url. If the URL cannot be parsed or the code parameter is not present, this will return None.
source§

fn get_code_from_user(&self, url: &str) -> ClientResult<String>

Tries to open the authorization URL in the user’s browser, and returns the obtained code. Read more
source§

fn prompt_for_token(&self, url: &str) -> ClientResult<()>

Opens up the authorization URL in the user’s browser so that it can authenticate. It reads from the standard input the redirect URI in order to obtain the access token information. The resulting access token will be saved internally once the operation is successful. Read more
source§

fn current_user_playlists( &self ) -> Paginator<'_, ClientResult<SimplifiedPlaylist>>

Get current user playlists without required getting his profile. Read more
source§

fn current_user_playlists_manual( &self, limit: Option<u32>, offset: Option<u32> ) -> ClientResult<Page<SimplifiedPlaylist>>

The manually paginated version of Self::current_user_playlists.
source§

fn user_playlist_create( &self, user_id: UserId<'_>, name: &str, public: Option<bool>, collaborative: Option<bool>, description: Option<&str> ) -> ClientResult<FullPlaylist>

Creates a playlist for a user. Read more
source§

fn playlist_change_detail( &self, playlist_id: PlaylistId<'_>, name: Option<&str>, public: Option<bool>, description: Option<&str>, collaborative: Option<bool> ) -> ClientResult<String>

Changes a playlist’s name and/or public/private state. Read more
source§

fn playlist_unfollow(&self, playlist_id: PlaylistId<'_>) -> ClientResult<()>

Unfollows (deletes) a playlist for a user. Read more
source§

fn playlist_add_items<'a>( &self, playlist_id: PlaylistId<'_>, items: impl IntoIterator<Item = PlayableId<'a>> + Send + 'a, position: Option<u32> ) -> ClientResult<PlaylistResult>

Adds items to a playlist. Read more
source§

fn playlist_replace_items<'a>( &self, playlist_id: PlaylistId<'_>, items: impl IntoIterator<Item = PlayableId<'a>> + Send + 'a ) -> ClientResult<()>

Replace all items in a playlist Read more
source§

fn playlist_reorder_items( &self, playlist_id: PlaylistId<'_>, range_start: Option<i32>, insert_before: Option<i32>, range_length: Option<u32>, snapshot_id: Option<&str> ) -> ClientResult<PlaylistResult>

Reorder items in a playlist. Read more
source§

fn playlist_remove_all_occurrences_of_items<'a>( &self, playlist_id: PlaylistId<'_>, track_ids: impl IntoIterator<Item = PlayableId<'a>> + Send + 'a, snapshot_id: Option<&str> ) -> ClientResult<PlaylistResult>

Removes all occurrences of the given items from the given playlist. Read more
source§

fn playlist_remove_specific_occurrences_of_items<'a>( &self, playlist_id: PlaylistId<'_>, items: impl IntoIterator<Item = ItemPositions<'a>> + Send + 'a, snapshot_id: Option<&str> ) -> ClientResult<PlaylistResult>

Removes specfic occurrences of the given items from the given playlist. Read more
source§

fn playlist_follow( &self, playlist_id: PlaylistId<'_>, public: Option<bool> ) -> ClientResult<()>

Add the current authenticated user as a follower of a playlist. Read more
source§

fn me(&self) -> ClientResult<PrivateUser>

Get detailed profile information about the current user. An alias for the ‘current_user’ method. Read more
source§

fn current_user(&self) -> ClientResult<PrivateUser>

Get detailed profile information about the current user. An alias for the ‘me’ method. Read more
source§

fn current_user_playing_item( &self ) -> ClientResult<Option<CurrentlyPlayingContext>>

Get information about the current users currently playing item. Read more
source§

fn current_user_saved_albums( &self, market: Option<Market> ) -> Paginator<'_, ClientResult<SavedAlbum>>

Gets a list of the albums saved in the current authorized user’s “Your Music” library Read more
source§

fn current_user_saved_albums_manual( &self, market: Option<Market>, limit: Option<u32>, offset: Option<u32> ) -> ClientResult<Page<SavedAlbum>>

The manually paginated version of Self::current_user_saved_albums.
source§

fn current_user_saved_tracks( &self, market: Option<Market> ) -> Paginator<'_, ClientResult<SavedTrack>>

Get a list of the songs saved in the current Spotify user’s “Your Music” library. Read more
source§

fn current_user_saved_tracks_manual( &self, market: Option<Market>, limit: Option<u32>, offset: Option<u32> ) -> ClientResult<Page<SavedTrack>>

The manually paginated version of Self::current_user_saved_tracks.
source§

fn current_user_followed_artists( &self, after: Option<&str>, limit: Option<u32> ) -> ClientResult<CursorBasedPage<FullArtist>>

Gets a list of the artists followed by the current authorized user. Read more
source§

fn current_user_saved_tracks_delete<'a>( &self, track_ids: impl IntoIterator<Item = TrackId<'a>> + Send + 'a ) -> ClientResult<()>

Remove one or more tracks from the current user’s “Your Music” library. Read more
source§

fn current_user_saved_tracks_contains<'a>( &self, track_ids: impl IntoIterator<Item = TrackId<'a>> + Send + 'a ) -> ClientResult<Vec<bool>>

Check if one or more tracks is already saved in the current Spotify user’s “Your Music” library. Read more
source§

fn current_user_saved_tracks_add<'a>( &self, track_ids: impl IntoIterator<Item = TrackId<'a>> + Send + 'a ) -> ClientResult<()>

Save one or more tracks to the current user’s “Your Music” library. Read more
source§

fn current_user_top_artists( &self, time_range: Option<TimeRange> ) -> Paginator<'_, ClientResult<FullArtist>>

Get the current user’s top artists. Read more
source§

fn current_user_top_artists_manual( &self, time_range: Option<TimeRange>, limit: Option<u32>, offset: Option<u32> ) -> ClientResult<Page<FullArtist>>

The manually paginated version of Self::current_user_top_artists.
source§

fn current_user_top_tracks( &self, time_range: Option<TimeRange> ) -> Paginator<'_, ClientResult<FullTrack>>

Get the current user’s top tracks. Read more
source§

fn current_user_top_tracks_manual( &self, time_range: Option<TimeRange>, limit: Option<u32>, offset: Option<u32> ) -> ClientResult<Page<FullTrack>>

The manually paginated version of Self::current_user_top_tracks.
source§

fn current_user_recently_played( &self, limit: Option<u32>, time_limit: Option<TimeLimits> ) -> ClientResult<CursorBasedPage<PlayHistory>>

Get the current user’s recently played tracks. Read more
source§

fn current_user_saved_albums_add<'a>( &self, album_ids: impl IntoIterator<Item = AlbumId<'a>> + Send + 'a ) -> ClientResult<()>

Add one or more albums to the current user’s “Your Music” library. Read more
source§

fn current_user_saved_albums_delete<'a>( &self, album_ids: impl IntoIterator<Item = AlbumId<'a>> + Send + 'a ) -> ClientResult<()>

Remove one or more albums from the current user’s “Your Music” library. Read more
source§

fn current_user_saved_albums_contains<'a>( &self, album_ids: impl IntoIterator<Item = AlbumId<'a>> + Send + 'a ) -> ClientResult<Vec<bool>>

Check if one or more albums is already saved in the current Spotify user’s “Your Music” library. Read more
source§

fn user_follow_artists<'a>( &self, artist_ids: impl IntoIterator<Item = ArtistId<'a>> + Send + 'a ) -> ClientResult<()>

Follow one or more artists. Read more
source§

fn user_unfollow_artists<'a>( &self, artist_ids: impl IntoIterator<Item = ArtistId<'a>> + Send + 'a ) -> ClientResult<()>

Unfollow one or more artists. Read more
source§

fn user_artist_check_follow<'a>( &self, artist_ids: impl IntoIterator<Item = ArtistId<'a>> + Send + 'a ) -> ClientResult<Vec<bool>>

Check to see if the current user is following one or more artists or other Spotify users. Read more
source§

fn user_follow_users<'a>( &self, user_ids: impl IntoIterator<Item = UserId<'a>> + Send + 'a ) -> ClientResult<()>

Follow one or more users. Read more
source§

fn user_unfollow_users<'a>( &self, user_ids: impl IntoIterator<Item = UserId<'a>> + Send + 'a ) -> ClientResult<()>

Unfollow one or more users. Read more
source§

fn device(&self) -> ClientResult<Vec<Device>>

Get a User’s Available Devices Read more
source§

fn current_playback<'a>( &self, country: Option<Market>, additional_types: Option<impl IntoIterator<Item = &'a AdditionalType> + Send + 'a> ) -> ClientResult<Option<CurrentPlaybackContext>>

Get Information About The User’s Current Playback Read more
source§

fn current_playing<'a>( &'a self, market: Option<Market>, additional_types: Option<impl IntoIterator<Item = &'a AdditionalType> + Send + 'a> ) -> ClientResult<Option<CurrentlyPlayingContext>>

Get the User’s Currently Playing Track Read more
source§

fn current_user_queue(&self) -> ClientResult<CurrentUserQueue>

Get the Current User’s Queue Read more
source§

fn transfer_playback( &self, device_id: &str, play: Option<bool> ) -> ClientResult<()>

Transfer a User’s Playback. Read more
source§

fn start_context_playback( &self, context_uri: PlayContextId<'_>, device_id: Option<&str>, offset: Option<Offset>, position: Option<Duration> ) -> ClientResult<()>

Start/Resume a User’s Playback. Read more
source§

fn start_uris_playback<'a>( &self, uris: impl IntoIterator<Item = PlayableId<'a>> + Send + 'a, device_id: Option<&str>, offset: Option<Offset>, position: Option<Duration> ) -> ClientResult<()>

Start a user’s playback Read more
source§

fn pause_playback(&self, device_id: Option<&str>) -> ClientResult<()>

Pause a User’s Playback. Read more
source§

fn resume_playback( &self, device_id: Option<&str>, position: Option<Duration> ) -> ClientResult<()>

Resume a User’s Playback. Read more
source§

fn next_track(&self, device_id: Option<&str>) -> ClientResult<()>

Skip User’s Playback To Next Track. Read more
source§

fn previous_track(&self, device_id: Option<&str>) -> ClientResult<()>

Skip User’s Playback To Previous Track. Read more
source§

fn seek_track( &self, position: Duration, device_id: Option<&str> ) -> ClientResult<()>

Seek To Position In Currently Playing Track. Read more
source§

fn repeat( &self, state: RepeatState, device_id: Option<&str> ) -> ClientResult<()>

Set Repeat Mode On User’s Playback. Read more
source§

fn volume( &self, volume_percent: u8, device_id: Option<&str> ) -> ClientResult<()>

Set Volume For User’s Playback. Read more
source§

fn shuffle(&self, state: bool, device_id: Option<&str>) -> ClientResult<()>

Toggle Shuffle For User’s Playback. Read more
source§

fn add_item_to_queue( &self, item: PlayableId<'_>, device_id: Option<&str> ) -> ClientResult<()>

Add an item to the end of the user’s playback queue. Read more
source§

fn save_shows<'a>( &self, show_ids: impl IntoIterator<Item = ShowId<'a>> + Send + 'a ) -> ClientResult<()>

Add a show or a list of shows to a user’s library. Read more
source§

fn get_saved_show(&self) -> Paginator<'_, ClientResult<Show>>

Get a list of shows saved in the current Spotify user’s library. Optional parameters can be used to limit the number of shows returned. Read more
source§

fn get_saved_show_manual( &self, limit: Option<u32>, offset: Option<u32> ) -> ClientResult<Page<Show>>

The manually paginated version of Self::get_saved_show.
source§

fn check_users_saved_shows<'a>( &self, ids: impl IntoIterator<Item = ShowId<'a>> + Send + 'a ) -> ClientResult<Vec<bool>>

Check if one or more shows is already saved in the current Spotify user’s library. Read more
source§

fn remove_users_saved_shows<'a>( &self, show_ids: impl IntoIterator<Item = ShowId<'a>> + Send + 'a, country: Option<Market> ) -> ClientResult<()>

Delete one or more shows from current Spotify user’s library. Changes to a user’s saved shows may not be visible in other Spotify applications immediately. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.