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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Performs the conversion.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Compare self to key and return true if they are equal.

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.