Enum rspotify_model::PlayableItem
source · pub enum PlayableItem {
Track(FullTrack),
Episode(FullEpisode),
}
Expand description
A full track object or a full episode object
Variants§
Track(FullTrack)
Episode(FullEpisode)
Implementations§
source§impl PlayableItem
impl PlayableItem
sourcepub fn id(&self) -> Option<PlayableId<'_>>
pub fn id(&self) -> Option<PlayableId<'_>>
Utility to get the ID from either variant in the enum.
Note that if it’s a track and if it’s local, it may not have an ID, in
which case this function will return None
.
Trait Implementations§
source§impl Clone for PlayableItem
impl Clone for PlayableItem
source§fn clone(&self) -> PlayableItem
fn clone(&self) -> PlayableItem
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for PlayableItem
impl Debug for PlayableItem
source§impl<'de> Deserialize<'de> for PlayableItem
impl<'de> Deserialize<'de> for PlayableItem
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for PlayableItem
impl PartialEq for PlayableItem
source§fn eq(&self, other: &PlayableItem) -> bool
fn eq(&self, other: &PlayableItem) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for PlayableItem
impl Serialize for PlayableItem
impl Eq for PlayableItem
impl StructuralPartialEq for PlayableItem
Auto Trait Implementations§
impl Freeze for PlayableItem
impl RefUnwindSafe for PlayableItem
impl Send for PlayableItem
impl Sync for PlayableItem
impl Unpin for PlayableItem
impl UnwindSafe for PlayableItem
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more