Struct mpris::Metadata
[−]
[src]
pub struct Metadata { /* fields omitted */ }
A structured representation of the Player
metadata.
Methods
impl Metadata
[src]
fn new(track_id: String) -> Self
[src]
Create a new Metadata
struct with a given track_id
.
This is mostly useful for test fixtures and other places where you want to work with mock data.
fn track_id(&self) -> &str
[src]
The track ID.
Based on mpris:trackId
A unique identity for this track within the context of an MPRIS object.
fn album_artists(&self) -> Option<&Vec<String>>
[src]
A list of artists of the album the track appears on.
Based on xesam:albumArtist
The album artist(s).
fn album_name(&self) -> Option<&str>
[src]
The name of the album the track appears on.
Based on xesam:album
The album name.
fn art_url(&self) -> Option<&str>
[src]
An URL to album art of the current track.
Based on mpris:artUrl
The location of an image representing the track or album. Clients should not assume this will continue to exist when the media player stops giving out the URL.
fn artists(&self) -> Option<&Vec<String>>
[src]
A list of artists of the track.
Based on xesam:artist
The track artist(s).
fn auto_rating(&self) -> Option<f64>
[src]
Based on xesam:autoRating
An automatically-generated rating, based on things such as how often it has been played. This should be in the range 0.0 to 1.0.
fn disc_number(&self) -> Option<i32>
[src]
Based on xesam:discNumber
The disc number on the album that this track is from.
fn length_in_microseconds(&self) -> Option<u64>
[src]
The duration of the track, in microseconds
Based on mpris:length
The duration of the track in microseconds.
fn length(&self) -> Option<Duration>
[src]
The duration of the track, as a Duration
Based on mpris:length
.
fn title(&self) -> Option<&str>
[src]
The name of the track.
Based on xesam:title
The track title.
fn track_number(&self) -> Option<i32>
[src]
The track number on the disc of the album the track appears on.
Based on xesam:trackNumber
The track number on the album disc.
fn url(&self) -> Option<&str>
[src]
A URL to the media being played.
Based on xesam:url
The location of the media file.
fn rest(&self) -> &HashMap<String, Variant<Box<RefArg>>>
[src]
Remaining metadata that has not been parsed into one of the other fields of the Metadata
,
if any.
As an example, if the media player exposed xesam:composer
, then you could read that
String like this:
use dbus::arg::RefArg; if let Some(name) = metadata.rest().get("xesam:composer").and_then(|v| v.as_str()) { println!("Composed by: {}", name) }