pub trait BusProperties {
type Body: Type + Serialize + for<'a> Deserialize<'a>;
const DBUS_MEMBER: &'static str;
const DBUS_INTERFACE: &'static str;
const MATCH_RULE_STRING: &'static str;
const REGISTRY_EVENT_STRING: &'static str;
// Required methods
fn from_message_parts(
item: ObjectRef,
body: Self::Body,
) -> Result<Self, AtspiError>
where Self: Sized;
fn body(&self) -> Self::Body;
}
Expand description
Describes the DBus
-related information about a given struct.
DBus
member nameDBus
interface nameDBus
match string: used to tellDBus
you are interested in a particular signal- accessibility registry event string: used to tell the accessibility registry that you are interested in a particular event
This trait is not object-safe.
For a similar, but object-safe trait, see EventProperties
.
Required Associated Constants§
Sourceconst DBUS_MEMBER: &'static str
const DBUS_MEMBER: &'static str
The DBus
member for the event.
For example, for an object::TextChangedEvent
this should be "TextChanged"
Sourceconst DBUS_INTERFACE: &'static str
const DBUS_INTERFACE: &'static str
The DBus
interface name for this event.
For example, for any event within object
, this should be “org.a11y.atspi.Event.Object”.
Sourceconst MATCH_RULE_STRING: &'static str
const MATCH_RULE_STRING: &'static str
A static match rule string for DBus
.
This should usually be a string that looks like this: "type='signal',interface='org.a11y.atspi.Event.Object',member='PropertyChange'"
;
This should be deprecated in favour of composing the string from Self::DBUS_MEMBER
and Self::DBUS_INTERFACE
.
Sourceconst REGISTRY_EVENT_STRING: &'static str
const REGISTRY_EVENT_STRING: &'static str
A registry event string for registering for event receiving via the RegistryProxy
.
This should be deprecated in favour of composing the string from Self::DBUS_MEMBER
and Self::DBUS_INTERFACE
.
Required Associated Types§
Sourcetype Body: Type + Serialize + for<'a> Deserialize<'a>
type Body: Type + Serialize + for<'a> Deserialize<'a>
What is the body type of this event.
Required Methods§
Sourcefn from_message_parts(
item: ObjectRef,
body: Self::Body,
) -> Result<Self, AtspiError>where
Self: Sized,
fn from_message_parts(
item: ObjectRef,
body: Self::Body,
) -> Result<Self, AtspiError>where
Self: Sized,
Build the event from the object pair (ObjectRef
and the Body).
§Errors
When the body type, which is what the raw message looks like over DBus
, does not match the type that is expected for the given event.
It is not possible for this to error on most events, but on events whose raw message Self::Body
type contains a zvariant::Value
, you may get errors when constructing the structure.
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.