Skip to main content

Track

Struct Track 

Source
pub struct Track {
Show 16 fields pub id: MediaId, pub album_id: MediaId, pub artist_id: MediaId, pub artist_name: Option<String>, pub album_title: Option<String>, pub title: String, pub track: Option<u32>, pub disc: Option<u32>, pub album_track_count: Option<u32>, pub codec: Option<AudioCodec>, pub bit_depth: Option<u32>, pub sample_rate: Option<u32>, pub duration: Option<Duration>, pub merge: MergeFacts, pub artwork: Vec<Artwork>, pub playback: PlaybackState,
}

Fields§

§id: MediaId§album_id: MediaId§artist_id: MediaId§artist_name: Option<String>

Who it is by, so a track shown alone (a search result, a queue) says whose it is: the track’s own artist where its tags name one (“Adele with Chris Stapleton”), else its album’s.

§album_title: Option<String>

Its album’s title, for the same reason.

§title: String§track: Option<u32>

Position on its disc, when the tags say.

§disc: Option<u32>§album_track_count: Option<u32>

How many tracks its album has (as Album::track_count), for “track 3 of 9”. Set on an album’s own tracks, the children of its item; None elsewhere.

§codec: Option<AudioCodec>

The audio codec, None when the catalog does not say.

§bit_depth: Option<u32>

Bits per sample (16, 24); None when not known, and for lossy codecs, which have none. Known for an album’s own tracks and a track’s own item, not in other listings or search.

§sample_rate: Option<u32>

Samples per second, in Hz (44_100, 96_000); known where bit_depth is.

§duration: Option<Duration>§merge: MergeFacts

What an app merging several servers’ libraries sorts by and matches copies by (MergeFacts). Left out of the wire when it holds nothing, and read as nothing from an older server.

§artwork: Vec<Artwork>

Its album’s cover as the poster, and its artist’s background.

§playback: PlaybackState

Trait Implementations§

Source§

impl Clone for Track

Source§

fn clone(&self) -> Self

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 Eq for Track

Source§

impl PartialEq for Track

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Track

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Track

Auto Trait Implementations§

§

impl Forget for Track

§

impl Freeze for Track

§

impl Move 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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> 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 = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.