Struct Track Copy item path Source pub struct Track {
pub name: String ,
pub artist: String ,
pub playcount: u32 ,
pub timestamp: Option <u64 >,
pub album: Option <String >,
pub album_artist: Option <String >,
}Expand description Represents a music track with associated metadata.
This structure contains track information as parsed from Last.fm pages,
including play count and optional timestamp data for scrobbles.
§ Examples
use lastfm_edit::Track;
let track = Track {
name: "Paranoid Android" .to_string(),
artist: "Radiohead" .to_string(),
playcount: 42 ,
timestamp: Some (1640995200 ), album: Some ("OK Computer" .to_string()),
album_artist: Some ("Radiohead" .to_string()),
};
println! ("{} by {} (played {} times)" , track.name, track.artist, track.playcount);
if let Some (album) = & track.album {
println! ("From album: {}" , album);
}
Number of times this track has been played/scrobbled
Unix timestamp of when this track was scrobbled (if available)
This field is populated when tracks are retrieved from recent scrobbles
or individual scrobble data, but may be None for aggregate track listings.
The album name (if available)
This field is populated when tracks are retrieved from recent scrobbles
where album information is available in the edit forms. May be None
for aggregate track listings or when album information is not available.
The album artist name (if available and different from track artist)
This field is populated when tracks are retrieved from recent scrobbles
where album artist information is available. May be None for tracks
where the album artist is the same as the track artist, or when this
information is not available.
Fetch the next item from the iterator.
Read more Get the current page number (0-indexed).
Read more Collect all remaining items into a Vec.
Read more Take up to n items from the iterator.
Read more Get the total number of pages, if known.
Read more Fetch the next item from the iterator.
Read more Get the current page number (0-indexed).
Read more Get the total number of pages, if known.
Read more Collect all remaining items into a Vec.
Read more Take up to n items from the iterator.
Read more Fetch the next item from the iterator.
Read more Get the current page number (0-indexed).
Read more Collect all remaining items into a Vec.
Read more Take up to n items from the iterator.
Read more Get the total number of pages, if known.
Read more Fetch the next item from the iterator.
Read more Get the current page number (0-indexed).
Read more Get the total number of pages, if known.
Read more Collect all remaining items into a Vec.
Read more Take up to n items from the iterator.
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 Serialize this value into the given Serde serializer.
Read more Immutably borrows from an owned value.
Read more Mutably borrows from an owned value.
Read more 🔬 This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from
self to
dest.
Read more Returns the argument unchanged.
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 Instruments this type with the provided
Span, returning an
Instrumented wrapper.
Read more Calls U::from(self).
That is, this conversion is whatever the implementation of
From <T> for U chooses to do.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning.
Read more 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.