macro_rules! impl_from_dbus_message {
($type:ty) => { ... };
($type:ty, Auto) => { ... };
($type:ty, Explicit) => { ... };
}Expand description
Implements the TryFrom trait for a given event type.
Converts a zbus::Message into a user facing event type.
See crate::events::MessageConversion for details on implementation.
§Example
ⓘ
impl_from_dbus_message!(StateChangedEvent);expands to:
ⓘ
impl TryFrom<&zbus::Message> for StateChangedEvents {
type Error = AtspiError;
fn try_from(msg: &zbus::Message) -> Result<Self, Self::Error> {
<$type as MessageConversion>::try_from_message(msg)
}
}There is also a variant that can be used for events whose crate::events::MessageConversion::Body is not
crate::events::event_body::EventBodyOwned. You can call this by setting the second parameter to Explicit.