Struct empris::EventManager [−][src]
pub struct EventManager<'a> { /* fields omitted */ }
Expand description
A struct that simplifies the process of adding
and removing listeners and callbacks to/from MPRIS’s
DBus
signals.
Implementations
Creates a new event manager.
Adds a new callback to the event manager.
Callbacks can be provided either as a closure, or as
a function. A callback takes only one parameter, a
Message
.
Errors
Returns an Err
if there is a failure in adding
a match rule to the connection.
Example
let mut manager = EventManager::new(&connection); // Be advised that it is important that this is assigned to a variable let _incoming = manager .add_callback(EventType::PropertiesChanged, |msg| { println!("Data: {:?}", msg); true }) .await?;
Auto Trait Implementations
impl<'a> !RefUnwindSafe for EventManager<'a>
impl<'a> Send for EventManager<'a>
impl<'a> Sync for EventManager<'a>
impl<'a> Unpin for EventManager<'a>
impl<'a> !UnwindSafe for EventManager<'a>