[−][src]Struct mpris::TrackID
Represents the MPRIS Track_Id
type.
use mpris::TrackID; let no_track = TrackID::new("/org/mpris/MediaPlayer2/TrackList/NoTrack").unwrap();
TrackIDs must be valid D-Bus object paths according to the spec.
Errors
Trying to construct a TrackID
from a string that is not a valid D-Bus Path will fail.
let result = TrackID::new("invalid track ID"); assert!(result.is_err());
Methods
impl TrackID
[src]
pub fn new<S: Into<String>>(id: S) -> Result<Self, String>
[src]
Create a new TrackID
from a string-like entity.
This is not something you should normally do as the IDs are temporary and will only work if the Player knows about it.
However, creating TrackID
s manually can help with test setup, comparisons, etc.
Example
use mpris::TrackID; let id = TrackID::new("/dbus/path/id").expect("Parse error");
pub fn no_track() -> Self
[src]
Return a new TrackID that matches the MPRIS standard for the "No track" sentinel value.
Some APIs takes this in order to signal a missing value for a track, for example by saying that no specific track is playing, or that a track should be added at the start of the list instead of after a specific track.
The actual path is "/org/mpris/MediaPlayer2/TrackList/NoTrack".
This value is only valid in some cases. Make sure to read the MPRIS specification before you use this manually.
pub fn as_str(&self) -> &str
[src]
Returns a &str
variant of the ID.
Trait Implementations
impl Clone for TrackID
[src]
impl Debug for TrackID
[src]
impl Display for TrackID
[src]
impl Eq for TrackID
[src]
impl<'a> From<&'a TrackID> for TrackID
[src]
impl<'a> From<&'a TrackID> for Path<'a>
[src]
impl<'a> From<Path<'a>> for TrackID
[src]
impl From<TrackID> for String
[src]
impl FromIterator<TrackID> for TrackList
[src]
fn from_iter<I: IntoIterator<Item = TrackID>>(iter: I) -> Self
[src]
impl Hash for TrackID
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl PartialEq<TrackID> for TrackID
[src]
impl StructuralEq for TrackID
[src]
impl StructuralPartialEq for TrackID
[src]
Auto Trait Implementations
impl RefUnwindSafe for TrackID
impl Send for TrackID
impl Sync for TrackID
impl Unpin for TrackID
impl UnwindSafe for TrackID
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
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, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,