Struct aspotify::model::Track [−][src]
pub struct Track {Show 18 fields
pub album: AlbumSimplified,
pub external_ids: HashMap<String, String>,
pub popularity: u32,
pub artists: Vec<ArtistSimplified>,
pub available_markets: Option<Vec<String>>,
pub disc_number: usize,
pub duration: Duration,
pub explicit: bool,
pub external_urls: HashMap<String, String>,
pub id: Option<String>,
pub is_playable: Option<bool>,
pub linked_from: Option<TrackLink>,
pub restrictions: Option<Restrictions>,
pub name: String,
pub preview_url: Option<String>,
pub track_number: usize,
pub item_type: TypeTrack,
pub is_local: bool,
}
Expand description
A track object.
Fields
album: AlbumSimplified
The album on which this track appears.
external_ids: HashMap<String, String>
Known external IDs for this track.
popularity: u32
The popularity of the track. The value will be between 0 and 100, with 100 being the most popular. The popularity is calculated from the total number of plays and how recent they are.
artists: Vec<ArtistSimplified>
The artists who performed the track.
available_markets: Option<Vec<String>>
The markets in which this track is available. Only Some
if the market parameter
is not supplied in the request. This is an ISO-3166 2-letter country code.
disc_number: usize
The disc number (1 unless the album contains more than one disc).
duration: Duration
The track length.
explicit: bool
Whether the track has explicit lyrics, false if unknown.
external_urls: HashMap<String, String>
Known external URLs for this track.
id: Option<String>
The Spotify ID for this track. Only not present for a local track, which can only ever be obtained from a playlist.
is_playable: Option<bool>
When track relinking is applied, if the track is playable in the given market.
linked_from: Option<TrackLink>
When track relinking is applied and the requested track has been replaced by a different one.
restrictions: Option<Restrictions>
When track relinking is applied, the original track isn’t available in the given market and Spotify didn’t have any tracks to relink it with, then this is Some.
name: String
The name of the track.
preview_url: Option<String>
Link to a 30 second MP3 preview of the track, doesn’t have to be there.
track_number: usize
The 1-indexed number of the track in its album; if the track has several discs, then it the number on the specified disc.
item_type: TypeTrack
The item type; track
.
is_local: bool
Whether the track is a local track.
Implementations
Convert to a TrackSimplified
.
Trait Implementations
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 RefUnwindSafe for Track
impl UnwindSafe for Track
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more