pub struct Enumerator { /* private fields */ }Expand description
Helper to list MPRIS players on D-Bus bus, and watch for addition/removal.
Uses org.freedesktop.DBus to watch for D-Bus client with starting with
org.mpris.MediaPlayer2.
Implementations§
Source§impl Enumerator
impl Enumerator
pub async fn new(connection: &Connection) -> Result<Self>
Sourcepub async fn receive_changes(
&self,
) -> Result<impl Stream<Item = Result<EnumeratorEvent>> + Unpin + use<>>
pub async fn receive_changes( &self, ) -> Result<impl Stream<Item = Result<EnumeratorEvent>> + Unpin + use<>>
Returns a stream that is signalled when an MPRIS client is added or removed
Sourcepub async fn players(&self) -> Result<Vec<OwnedBusName>>
pub async fn players(&self) -> Result<Vec<OwnedBusName>>
Get names of all MPRIS players currently on the bus
Auto Trait Implementations§
impl Freeze for Enumerator
impl !RefUnwindSafe for Enumerator
impl Send for Enumerator
impl Sync for Enumerator
impl Unpin for Enumerator
impl UnsafeUnpin for Enumerator
impl !UnwindSafe for Enumerator
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