Struct mpris::Metadata [] [src]

pub struct Metadata { /* fields omitted */ }

A structured representation of the Player metadata.

Methods

impl Metadata
[src]

[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.

[src]

The track ID.

Based on mpris:trackId

A unique identity for this track within the context of an MPRIS object.

[src]

A list of artists of the album the track appears on.

Based on xesam:albumArtist

The album artist(s).

[src]

The name of the album the track appears on.

Based on xesam:album

The album name.

[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.

[src]

A list of artists of the track.

Based on xesam:artist

The track artist(s).

[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.

[src]

Based on xesam:discNumber

The disc number on the album that this track is from.

[src]

The duration of the track, in microseconds

Based on mpris:length

The duration of the track in microseconds.

[src]

The duration of the track, as a Duration

Based on mpris:length.

[src]

The name of the track.

Based on xesam:title

The track title.

[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.

[src]

A URL to the media being played.

Based on xesam:url

The location of the media file.

[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)
}

Trait Implementations

impl Debug for Metadata
[src]

[src]

Formats the value using the given formatter.