Trait MessageConversion

Source
pub trait MessageConversion: BusProperties {
    type Body: Type + Serialize + for<'a> Deserialize<'a>;

    // Required methods
    fn from_message_unchecked(msg: &Message) -> Result<Self, AtspiError>
       where Self: Sized;
    fn from_message_unchecked_parts(
        obj_ref: ObjectRef,
        body: Self::Body,
    ) -> Result<Self, AtspiError>
       where Self: Sized;
    fn body(&self) -> Self::Body;
}

Required Associated Types§

Source

type Body: Type + Serialize + for<'a> Deserialize<'a>

What is the body type of this event.

Required Methods§

Source

fn from_message_unchecked(msg: &Message) -> Result<Self, AtspiError>
where Self: Sized,

Build an event from a zbus::Message reference. This function will not check for any of the following error conditions:

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.

Source

fn from_message_unchecked_parts( obj_ref: ObjectRef, body: Self::Body, ) -> 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:

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.

Source

fn body(&self) -> Self::Body

The body of the object.

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

Source§

impl MessageConversion for LegacyAddAccessibleEvent

Source§

impl MessageConversion for RemoveAccessibleEvent

Source§

impl MessageConversion for ModifiersEvent

Source§

impl MessageConversion for AbsEvent

Source§

impl MessageConversion for ButtonEvent

Source§

impl MessageConversion for RelEvent

Source§

impl MessageConversion for ActiveDescendantChangedEvent

Source§

impl MessageConversion for AnnouncementEvent

Source§

impl MessageConversion for ChildrenChangedEvent

Source§

impl MessageConversion for atspi_common::events::object::PropertyChangeEvent

Source§

impl MessageConversion for StateChangedEvent

Source§

impl MessageConversion for TextCaretMovedEvent

Source§

impl MessageConversion for TextChangedEvent

Source§

impl MessageConversion for AvailableEvent

Source§

impl MessageConversion for EventListenerDeregisteredEvent

Source§

impl MessageConversion for EventListenerRegisteredEvent

Source§

impl MessageConversion for atspi_common::events::window::PropertyChangeEvent

Source§

impl<T> MessageConversion for T