pub struct PlayerSnapshot {Show 14 fields
pub status: PlaybackStatus,
pub track_id: String,
pub title: String,
pub artist: String,
pub album: String,
pub art_url: String,
pub length_us: i64,
pub position_us: i64,
pub volume: f64,
pub can_next: bool,
pub can_prev: bool,
pub can_play: bool,
pub can_pause: bool,
pub can_seek: bool,
}Expand description
A snapshot of everything MPRIS exposes about the player.
Fields§
§status: PlaybackStatus§track_id: StringStable track id → the mpris:trackid object path. Empty ⇒ no track.
title: String§artist: String§album: String§art_url: Stringmpris:artUrl — an http(s) cover URL (or empty).
length_us: i64mpris:length, microseconds (0 ⇒ unknown).
position_us: i64Position, microseconds.
volume: f64Volume, 0.0..=1.0.
can_next: bool§can_prev: bool§can_play: bool§can_pause: bool§can_seek: boolImplementations§
Source§impl PlayerSnapshot
impl PlayerSnapshot
Sourcepub fn metadata_differs(&self, other: &Self) -> bool
pub fn metadata_differs(&self, other: &Self) -> bool
Whether two snapshots differ in a field that appears in MPRIS
Metadata (track identity / display / length).
Sourcepub fn should_republish(&self, last: &Self) -> bool
pub fn should_republish(&self, last: &Self) -> bool
Whether a re-publish is worthwhile: any material field changed, or the
playhead moved enough that a polling client would want a fresh
Position. Ignores sub-second position jitter to avoid signal spam.
Trait Implementations§
Source§impl Clone for PlayerSnapshot
impl Clone for PlayerSnapshot
Source§impl Debug for PlayerSnapshot
impl Debug for PlayerSnapshot
Source§impl Default for PlayerSnapshot
impl Default for PlayerSnapshot
Source§impl PartialEq for PlayerSnapshot
impl PartialEq for PlayerSnapshot
impl StructuralPartialEq for PlayerSnapshot
Auto Trait Implementations§
impl Forget for PlayerSnapshot
impl Freeze for PlayerSnapshot
impl Move for PlayerSnapshot
impl RefUnwindSafe for PlayerSnapshot
impl Send for PlayerSnapshot
impl Sync for PlayerSnapshot
impl Unpin for PlayerSnapshot
impl UnsafeUnpin for PlayerSnapshot
impl UnwindSafe for PlayerSnapshot
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more