Skip to main content

Track

Struct Track 

Source
pub struct Track {
Show 20 fields pub album: SimplifiedAlbum, pub artists: Vec<SimplifiedArtist>, pub available_markets: Option<Vec<String>>, pub disc_number: u32, pub duration_ms: u32, pub explicit: bool, pub external_ids: ExternalIds, pub external_urls: ExternalUrls, pub href: String, pub id: String, pub is_playable: Option<bool>, pub linked_from: Option<LinkedFrom>, pub restrictions: Option<Restriction>, pub name: String, pub popularity: u32, pub preview_url: Option<String>, pub track_number: u32, pub type: String, pub uri: String, pub is_local: bool,
}
Expand description

A track.

Fields§

§album: SimplifiedAlbum

The album the track belongs to.

§artists: Vec<SimplifiedArtist>

The artists who performed on the track.

§available_markets: Option<Vec<String>>

The ISO 3166-1 alpha-2 codes for the markets in which the track is available.

§disc_number: u32

The disc number, which us usually 1, unless the album consists of more than one disk.

§duration_ms: u32

The duration of the track in miliseconds.

§explicit: bool

Whether or not the track contains explicit content.

Note: false can also mean unknown.

§external_ids: ExternalIds

Known external IDs for the track.

§external_urls: ExternalUrls

Known external URLs for the track.

§href: String

A link to the Spotify Web API endpoint providing full details of the track.

§id: String

The Spotify ID for the track.

§is_playable: Option<bool>

Indicates whether or not the track is playable in the current market. It’s part of the response when Track Relinking is applied.

§linked_from: Option<LinkedFrom>

It’s part of the response when Track Relinking has been applied and the requested track has been replaced with a different one. This field contains information about the originally requested track.

§restrictions: Option<Restriction>

Included in the response when a content restriction is applied.

§name: String

The name of the track.

§popularity: u32

A value ranging between 0 - 100 that represents the popularity of a track. The popularity is based mostly on the number of times the track has been played and how recently it’s been played.

Duplicate tracks - the same track from a single and an album are rated independently.

Note: the value may lag behind by a few days, as it’s not updated in real time.

§preview_url: Option<String>

The URL for a 30 second MP3 preview of the track.

Note: This attribute has been deprecated by Spotify. It continues to work for applications already using the extended mode in the API.

You can read more about this here.

§track_number: u32

The number of the track.

§type: String

The object type. Allowed values: track.

§uri: String

The Spotify URI for the track.

§is_local: bool

Whether or not the track is from a local file.

Trait Implementations§

Source§

impl Clone for Track

Source§

fn clone(&self) -> Track

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Track

Source§

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

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

impl<'de> Deserialize<'de> for Track

Source§

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 Track

Source§

fn eq(&self, other: &Track) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · 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 StructuralPartialEq for Track

Auto Trait Implementations§

§

impl Freeze for Track

§

impl RefUnwindSafe for Track

§

impl Send for Track

§

impl Sync for Track

§

impl Unpin for Track

§

impl UnsafeUnpin for Track

§

impl UnwindSafe for Track

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, dest: *mut u8)

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

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

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

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,