Enum rspotify::prelude::PlayContextId

source ·
pub enum PlayContextId<'a> {
    Artist(ArtistId<'a>),
    Album(AlbumId<'a>),
    Playlist(PlaylistId<'a>),
    Show(ShowId<'a>),
}
Expand description

Grouping up multiple kinds of IDs to treat them generically. This also implements Id, and From to instantiate it.

Variants§

§

Artist(ArtistId<'a>)

§

Album(AlbumId<'a>)

§

Playlist(PlaylistId<'a>)

§

Show(ShowId<'a>)

Implementations§

source§

impl<'a> PlayContextId<'a>

source

pub fn as_ref(&'a self) -> PlayContextId<'a>

source

pub fn into_static(self) -> PlayContextId<'static>

source

pub fn clone_static(&'a self) -> PlayContextId<'static>

Trait Implementations§

source§

impl<'a> Clone for PlayContextId<'a>

source§

fn clone(&self) -> PlayContextId<'a>

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<'a> Debug for PlayContextId<'a>

source§

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

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

impl<'a> From<AlbumId<'a>> for PlayContextId<'a>

source§

fn from(v: AlbumId<'a>) -> PlayContextId<'a>

Converts to this type from the input type.
source§

impl<'a> From<ArtistId<'a>> for PlayContextId<'a>

source§

fn from(v: ArtistId<'a>) -> PlayContextId<'a>

Converts to this type from the input type.
source§

impl<'a> From<PlaylistId<'a>> for PlayContextId<'a>

source§

fn from(v: PlaylistId<'a>) -> PlayContextId<'a>

Converts to this type from the input type.
source§

impl<'a> From<ShowId<'a>> for PlayContextId<'a>

source§

fn from(v: ShowId<'a>) -> PlayContextId<'a>

Converts to this type from the input type.
source§

impl<'a> Hash for PlayContextId<'a>

source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

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

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.

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.

source§

impl<'a> PartialEq for PlayContextId<'a>

source§

fn eq(&self, other: &PlayContextId<'a>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a> Serialize for PlayContextId<'a>

source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<'a> TryInto<AlbumId<'a>> for PlayContextId<'a>

source§

type Error = &'static str

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

fn try_into( self, ) -> Result<AlbumId<'a>, <PlayContextId<'a> as TryInto<AlbumId<'a>>>::Error>

Performs the conversion.
source§

impl<'a> TryInto<ArtistId<'a>> for PlayContextId<'a>

source§

type Error = &'static str

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

fn try_into( self, ) -> Result<ArtistId<'a>, <PlayContextId<'a> as TryInto<ArtistId<'a>>>::Error>

Performs the conversion.
source§

impl<'a> TryInto<PlaylistId<'a>> for PlayContextId<'a>

source§

type Error = &'static str

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

fn try_into( self, ) -> Result<PlaylistId<'a>, <PlayContextId<'a> as TryInto<PlaylistId<'a>>>::Error>

Performs the conversion.
source§

impl<'a> TryInto<ShowId<'a>> for PlayContextId<'a>

source§

type Error = &'static str

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

fn try_into( self, ) -> Result<ShowId<'a>, <PlayContextId<'a> as TryInto<ShowId<'a>>>::Error>

Performs the conversion.
source§

impl<'a> Eq for PlayContextId<'a>

source§

impl<'a> StructuralPartialEq for PlayContextId<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for PlayContextId<'a>

§

impl<'a> RefUnwindSafe for PlayContextId<'a>

§

impl<'a> Send for PlayContextId<'a>

§

impl<'a> Sync for PlayContextId<'a>

§

impl<'a> Unpin for PlayContextId<'a>

§

impl<'a> UnwindSafe for PlayContextId<'a>

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> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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

source§

type Output = T

Should always be Self
source§

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

source§

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>,

source§

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>,

source§

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.