pub struct Track {Show 20 fields
pub album: Option<AlbumSimplified>,
pub artists: Option<Vec<ArtistSimplified>>,
pub available_markets: Option<Vec<String>>,
pub disc_number: Option<u32>,
pub duration_ms: u64,
pub explicit: Option<bool>,
pub external_ids: Option<ExternalIds>,
pub external_urls: Option<ExternalUrls>,
pub href: Option<String>,
pub id: String,
pub is_playable: Option<bool>,
pub linked_from: Option<LinkedFrom>,
pub restrictions: Option<Restrictions>,
pub name: String,
pub popularity: Option<u32>,
pub preview_url: Option<String>,
pub track_number: Option<u32>,
pub item_type: String,
pub uri: String,
pub is_local: Option<bool>,
}Expand description
Full track object.
Fields§
§album: Option<AlbumSimplified>Album containing the track.
artists: Option<Vec<ArtistSimplified>>Artists who performed the track.
available_markets: Option<Vec<String>>Markets where the track is available.
disc_number: Option<u32>Disc number.
duration_ms: u64Track duration in milliseconds.
explicit: Option<bool>Whether the track has explicit lyrics.
external_ids: Option<ExternalIds>External IDs (ISRC, etc.).
external_urls: Option<ExternalUrls>External URLs.
href: Option<String>Spotify URL.
id: StringSpotify ID.
is_playable: Option<bool>Whether the track is playable.
linked_from: Option<LinkedFrom>Linked track info if relinked.
restrictions: Option<Restrictions>Restrictions if any.
name: StringTrack name.
popularity: Option<u32>Popularity score (0-100).
preview_url: Option<String>Preview URL.
track_number: Option<u32>Track number on the disc.
item_type: StringObject type (always “track”).
uri: StringSpotify URI.
is_local: Option<bool>Whether the track is a local file.
Implementations§
Source§impl Track
impl Track
Sourcepub fn artist_name(&self) -> Option<&str>
pub fn artist_name(&self) -> Option<&str>
Get the primary artist name.
Sourcepub fn artist_names(&self) -> String
pub fn artist_names(&self) -> String
Get all artist names joined.
Sourcepub fn album_name(&self) -> Option<&str>
pub fn album_name(&self) -> Option<&str>
Get the album name.
Sourcepub fn duration_str(&self) -> String
pub fn duration_str(&self) -> String
Get duration as MM:SS string.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Track
impl<'de> Deserialize<'de> for Track
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
Auto Trait Implementations§
impl Freeze for Track
impl RefUnwindSafe for Track
impl Send for Track
impl Sync for Track
impl Unpin for Track
impl UnwindSafe for Track
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