Trait rspotify::prelude::Id

source ·
pub trait Id {
    // Required methods
    fn id(&self) -> &str;
    fn _type(&self) -> Type;

    // Provided methods
    fn uri(&self) -> String { ... }
    fn url(&self) -> String { ... }
}
Expand description

The main interface for an ID.

See the module level documentation for more information.

Required Methods§

source

fn id(&self) -> &str

Returns the inner Spotify object ID, which is guaranteed to be valid for its type.

source

fn _type(&self) -> Type

The type of the ID, as a function.

Provided Methods§

source

fn uri(&self) -> String

Returns a Spotify object URI in a well-known format: spotify:type:id.

Examples: spotify:album:6IcGNaXFRf5Y1jc7QsE9O2, spotify:track:4y4VO05kYgUTo2bzbox1an.

source

fn url(&self) -> String

Returns a full Spotify object URL that can be opened in a browser.

Examples: https://open.spotify.com/track/4y4VO05kYgUTo2bzbox1an, https://open.spotify.com/artist/2QI8e2Vwgg9KXOz2zjcrkI.

Implementors§

source§

impl Id for AlbumId<'_>

source§

impl Id for ArtistId<'_>

source§

impl Id for EpisodeId<'_>

source§

impl Id for PlaylistId<'_>

source§

impl Id for ShowId<'_>

source§

impl Id for TrackId<'_>

source§

impl Id for UserId<'_>

source§

impl<'a> Id for PlayContextId<'a>

source§

impl<'a> Id for PlayableId<'a>