pub trait MessageConversion<'a>: DBusProperties {
type Body<'msg>: Type + Deserialize<'msg> + Serialize
where Self: 'msg;
// Required methods
fn from_message_unchecked(
msg: &Message,
header: &Header<'_>,
) -> Result<Self, AtspiError>
where Self: Sized + 'a;
fn from_message_unchecked_parts(
obj_ref: ObjectRef<'_>,
body: DbusBody,
) -> Result<Self, AtspiError>
where Self: Sized;
fn body(&self) -> Self::Body<'_>;
}Required Associated Types§
Sourcetype Body<'msg>: Type + Deserialize<'msg> + Serialize
where
Self: 'msg
type Body<'msg>: Type + Deserialize<'msg> + Serialize where Self: 'msg
What is the body type of this event.
Required Methods§
Sourcefn from_message_unchecked(
msg: &Message,
header: &Header<'_>,
) -> Result<Self, AtspiError>where
Self: Sized + 'a,
fn from_message_unchecked(
msg: &Message,
header: &Header<'_>,
) -> Result<Self, AtspiError>where
Self: Sized + 'a,
Build an event from a zbus::Message reference.
This function will not check for any of the following error conditions:
- That the message has an interface:
AtspiError::MissingInterface - That the message interface matches the one for the event:
AtspiError::InterfaceMatch - That the message has an member:
AtspiError::MissingMember - That the message member matches the one for the event:
AtspiError::MemberMatch - That the message signature matches the one for the event:
AtspiError::SignatureMatch
Therefore, this should only be used when one has checked the above conditions.
These must be checked manually.
Alternatively, there is the MessageConversionExt::try_from_message that will check these
conditions for you.
This type also implements TryFrom<&zbus::Message>; consider using this if you are not an
internal developer.
§Errors
It is possible to get a AtspiError::Zvariant error if you do not check the proper
conditions before calling this.
Sourcefn from_message_unchecked_parts(
obj_ref: ObjectRef<'_>,
body: DbusBody,
) -> Result<Self, AtspiError>where
Self: Sized,
fn from_message_unchecked_parts(
obj_ref: ObjectRef<'_>,
body: DbusBody,
) -> Result<Self, AtspiError>where
Self: Sized,
Build an event from an ObjectRef and Self::Body.
This function will not check for any of the following error conditions:
- That the message has an interface:
AtspiError::MissingInterface - That the message interface matches the one for the event:
AtspiError::InterfaceMatch - That the message has an member:
AtspiError::MissingMember - That the message member matches the one for the event:
AtspiError::MemberMatch
Therefore, this should only be used when one has checked the above conditions.
§Errors
Some Self::Body types may fallibly convert data fields contained in the body.
If this happens, then the function will return an error.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
Source§impl MessageConversion<'_> for AddAccessibleEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for AddAccessibleEvent
zbus only.Source§impl MessageConversion<'_> for LegacyAddAccessibleEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for LegacyAddAccessibleEvent
zbus only.type Body<'msg> = LegacyCacheItem
Source§impl MessageConversion<'_> for RemoveAccessibleEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for RemoveAccessibleEvent
zbus only.type Body<'msg> = ObjectRefOwned
Source§impl MessageConversion<'_> for atspi_common::events::document::AttributesChangedEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for atspi_common::events::document::AttributesChangedEvent
zbus only.Source§impl MessageConversion<'_> for ContentChangedEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for ContentChangedEvent
zbus only.Source§impl MessageConversion<'_> for LoadCompleteEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for LoadCompleteEvent
zbus only.Source§impl MessageConversion<'_> for LoadStoppedEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for LoadStoppedEvent
zbus only.Source§impl MessageConversion<'_> for PageChangedEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for PageChangedEvent
zbus only.Source§impl MessageConversion<'_> for ReloadEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for ReloadEvent
zbus only.Source§impl MessageConversion<'_> for FocusEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for FocusEvent
zbus only.Source§impl MessageConversion<'_> for ModifiersEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for ModifiersEvent
zbus only.Source§impl MessageConversion<'_> for AbsEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for AbsEvent
zbus only.Source§impl MessageConversion<'_> for ButtonEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for ButtonEvent
zbus only.Source§impl MessageConversion<'_> for RelEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for RelEvent
zbus only.Source§impl MessageConversion<'_> for ActiveDescendantChangedEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for ActiveDescendantChangedEvent
zbus only.Source§impl MessageConversion<'_> for AnnouncementEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for AnnouncementEvent
zbus only.Source§impl MessageConversion<'_> for atspi_common::events::object::AttributesChangedEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for atspi_common::events::object::AttributesChangedEvent
zbus only.Source§impl MessageConversion<'_> for BoundsChangedEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for BoundsChangedEvent
zbus only.Source§impl MessageConversion<'_> for ChildrenChangedEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for ChildrenChangedEvent
zbus only.Source§impl MessageConversion<'_> for ColumnDeletedEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for ColumnDeletedEvent
zbus only.Source§impl MessageConversion<'_> for ColumnInsertedEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for ColumnInsertedEvent
zbus only.Source§impl MessageConversion<'_> for ColumnReorderedEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for ColumnReorderedEvent
zbus only.Source§impl MessageConversion<'_> for LinkSelectedEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for LinkSelectedEvent
zbus only.Source§impl MessageConversion<'_> for ModelChangedEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for ModelChangedEvent
zbus only.Source§impl MessageConversion<'_> for atspi_common::events::object::PropertyChangeEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for atspi_common::events::object::PropertyChangeEvent
zbus only.Source§impl MessageConversion<'_> for RowDeletedEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for RowDeletedEvent
zbus only.Source§impl MessageConversion<'_> for RowInsertedEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for RowInsertedEvent
zbus only.Source§impl MessageConversion<'_> for RowReorderedEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for RowReorderedEvent
zbus only.Source§impl MessageConversion<'_> for SelectionChangedEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for SelectionChangedEvent
zbus only.Source§impl MessageConversion<'_> for StateChangedEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for StateChangedEvent
zbus only.Source§impl MessageConversion<'_> for TextAttributesChangedEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for TextAttributesChangedEvent
zbus only.Source§impl MessageConversion<'_> for TextBoundsChangedEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for TextBoundsChangedEvent
zbus only.Source§impl MessageConversion<'_> for TextCaretMovedEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for TextCaretMovedEvent
zbus only.Source§impl MessageConversion<'_> for TextChangedEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for TextChangedEvent
zbus only.Source§impl MessageConversion<'_> for TextSelectionChangedEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for TextSelectionChangedEvent
zbus only.Source§impl MessageConversion<'_> for VisibleDataChangedEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for VisibleDataChangedEvent
zbus only.Source§impl MessageConversion<'_> for AvailableEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for AvailableEvent
zbus only.Source§impl MessageConversion<'_> for EventListenerDeregisteredEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for EventListenerDeregisteredEvent
zbus only.type Body<'a> = EventListeners
Source§impl MessageConversion<'_> for EventListenerRegisteredEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for EventListenerRegisteredEvent
zbus only.type Body<'a> = EventListeners
Source§impl MessageConversion<'_> for ApplicationChangedEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for ApplicationChangedEvent
zbus only.Source§impl MessageConversion<'_> for CharWidthChangedEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for CharWidthChangedEvent
zbus only.Source§impl MessageConversion<'_> for ColumnCountChangedEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for ColumnCountChangedEvent
zbus only.Source§impl MessageConversion<'_> for LineChangedEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for LineChangedEvent
zbus only.Source§impl MessageConversion<'_> for LineCountChangedEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for LineCountChangedEvent
zbus only.Source§impl MessageConversion<'_> for ActivateEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for ActivateEvent
zbus only.Source§impl MessageConversion<'_> for CloseEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for CloseEvent
zbus only.Source§impl MessageConversion<'_> for CreateEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for CreateEvent
zbus only.Source§impl MessageConversion<'_> for DeactivateEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for DeactivateEvent
zbus only.Source§impl MessageConversion<'_> for DesktopCreateEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for DesktopCreateEvent
zbus only.Source§impl MessageConversion<'_> for DesktopDestroyEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for DesktopDestroyEvent
zbus only.Source§impl MessageConversion<'_> for DestroyEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for DestroyEvent
zbus only.Source§impl MessageConversion<'_> for LowerEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for LowerEvent
zbus only.Source§impl MessageConversion<'_> for MaximizeEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for MaximizeEvent
zbus only.Source§impl MessageConversion<'_> for MinimizeEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for MinimizeEvent
zbus only.Source§impl MessageConversion<'_> for MoveEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for MoveEvent
zbus only.Source§impl MessageConversion<'_> for atspi_common::events::window::PropertyChangeEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for atspi_common::events::window::PropertyChangeEvent
zbus only.Source§impl MessageConversion<'_> for RaiseEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for RaiseEvent
zbus only.Source§impl MessageConversion<'_> for ReparentEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for ReparentEvent
zbus only.Source§impl MessageConversion<'_> for ResizeEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for ResizeEvent
zbus only.Source§impl MessageConversion<'_> for RestoreEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for RestoreEvent
zbus only.Source§impl MessageConversion<'_> for RestyleEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for RestyleEvent
zbus only.Source§impl MessageConversion<'_> for ShadeEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for ShadeEvent
zbus only.Source§impl MessageConversion<'_> for UUshadeEvent
Available on crate feature zbus only.
impl MessageConversion<'_> for UUshadeEvent
zbus only.