Crate empris[−][src]
Expand description
This library provides a high-level interface to the MPRIS DBus
specification.
It allows both controlling of a player, as well as listening for events and executing callbacks.
A basic player controller
use empris::{self, Player}; #[tokio::main] async fn main() -> Result<(), Box<dyn std::error::Error>> { // Create a connection to work with let conn = empris::get_connection(); // Get a player under the name "vlc" let player = Player::try_new("vlc", &conn).await?; // Play/pause the player player.play_pause().await?; }
This crate re-exports Message
for use
in typing non-closure callbacks.
Re-exports
pub use dbus::message::Message; |
Modules
methods | Provides all of the methods needed to control and
work with a |
Structs
EventManager | A struct that simplifies the process of adding
and removing listeners and callbacks to/from MPRIS’s
|
Player | A struct used to control an MPRIS player. |
Enums
EventType | Enum for indicating which type of MPRIS event to listen for. |
Functions
get_all_players | Gets a |
get_connection | Establishes a connection to the |
prop_cast | Gets a value from a HashMap, and casts it to the type provided. |