pub struct Track {
pub name: String,
pub artist: String,
pub playcount: u32,
pub timestamp: Option<u64>,
pub album: 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), // Unix timestamp
album: Some("OK Computer".to_string()),
};
println!("{} by {} (played {} times)", track.name, track.artist, track.playcount);
if let Some(album) = &track.album {
println!("From album: {}", album);
}Fields§
§name: StringThe track name/title
artist: StringThe artist name
playcount: u32Number of times this track has been played/scrobbled
timestamp: Option<u64>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.
album: Option<String>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.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Track
impl RefUnwindSafe for Track
impl Send for Track
impl Sync for Track
impl Unpin for Track
impl UnwindSafe for Track
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more