[−][src]Struct mpris::Metadata
A structured representation of the Player
metadata.
Methods
impl Metadata
[src]
pub fn new<S>(track_id: S) -> Self where
S: Into<String>,
[src]
S: Into<String>,
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.
pub fn get(&self, key: &str) -> Option<&Value>
[src]
Get a value from the metadata by key name.
Examples
if let Some(MetadataValue::String(name)) = metadata.get("xesam:composer") { println!("Composed by: {}", name); }
pub fn track_id(&self) -> Option<TrackID>
[src]
The track ID.
If the TrackID could not be parsed as a proper TrackID, None
will be returned.
Based on mpris:trackid
A unique identity for this track within the context of an MPRIS object.
pub fn album_artists(&self) -> Option<Vec<&str>>
[src]
A list of artists of the album the track appears on.
Based on xesam:albumArtist
The album artist(s).
pub fn album_name(&self) -> Option<&str>
[src]
The name of the album the track appears on.
Based on xesam:album
The album name.
pub 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.
pub fn artists(&self) -> Option<Vec<&str>>
[src]
A list of artists of the track.
Based on xesam:artist
The track artist(s).
pub 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.
pub fn disc_number(&self) -> Option<i32>
[src]
Based on xesam:discNumber
The disc number on the album that this track is from.
pub 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.
pub fn length(&self) -> Option<Duration>
[src]
The duration of the track, as a Duration
Based on mpris:length
.
pub fn title(&self) -> Option<&str>
[src]
The name of the track.
Based on xesam:title
The track title.
pub 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.
pub fn url(&self) -> Option<&str>
[src]
A URL to the media being played.
Based on xesam:url
The location of the media file.
Trait Implementations
impl Clone for Metadata
[src]
fn clone(&self) -> Metadata
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Default for Metadata
[src]
impl From<Metadata> for HashMap<String, Value>
[src]
impl From<HashMap<String, Value, RandomState>> for Metadata
[src]
impl Debug for Metadata
[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,