### Example: Get the path of the object reference Source: https://docs.rs/atspi/0.29.0/atspi/struct.ObjectRefOwned.html Illustrates how to retrieve and assert the object path of an `ObjectRef` using `path()` and `path_as_str()`. ```rust use zbus::names::UniqueName; use zbus::zvariant::ObjectPath; use atspi_common::ObjectRef; let name = UniqueName::from_static_str_unchecked(":1.23"); let path = ObjectPath::from_static_str_unchecked("/org/a11y/example/path/007"); let object_ref = ObjectRef::new_borrowed(name, path); assert_eq!(object_ref.path_as_str(), "/org/a11y/example/path/007"); ``` -------------------------------- ### Example: Accessing name and path of an ObjectRef Source: https://docs.rs/atspi/0.29.0/atspi/object_ref/struct.ObjectRefOwned.html Demonstrates how to create a borrowed ObjectRef and then access its name and path using the respective methods. ```rust use zbus::names::UniqueName; use zbus::zvariant::ObjectPath; use atspi_common::ObjectRef; let name = UniqueName::from_static_str_unchecked(":1.23"); let path = ObjectPath::from_static_str_unchecked("/org/a11y/example/path/007"); let object_ref = ObjectRef::new_borrowed(name, path); // Check the name of the object reference assert!(object_ref.name().is_some()); assert_eq!(object_ref.name_as_str().unwrap(), ":1.23"); assert_eq!(object_ref.path_as_str(), "/org/a11y/example/path/007"); ``` -------------------------------- ### Example: Get the name of the object reference Source: https://docs.rs/atspi/0.29.0/atspi/struct.ObjectRefOwned.html Demonstrates how to obtain and check the name of an `ObjectRef` using `name()` and `name_as_str()`. ```rust use zbus::names::UniqueName; use zbus::zvariant::ObjectPath; use atspi_common::ObjectRef; let name = UniqueName::from_static_str_unchecked(":1.23"); let path = ObjectPath::from_static_str_unchecked("/org/a11y/example/path/007"); let object_ref = ObjectRef::new_borrowed(name, path); // Check the name of the object reference assert!(object_ref.name().is_some()); assert_eq!(object_ref.name_as_str().unwrap(), ":1.23"); ``` -------------------------------- ### Create AccessibilityConnection and Get Accessible Proxy Source: https://docs.rs/atspi/0.29.0/atspi/struct.AccessibilityConnection.html Demonstrates how to establish an AccessibilityConnection and retrieve an AccessibleProxy for a given object reference. Handles potential errors during proxy retrieval. ```rust use zbus::names::UniqueName; use zbus::zvariant::ObjectPath; use atspi_proxies::accessible::AccessibleProxy; use atspi_common::ObjectRef; use atspi_connection::{P2P, Peer}; use atspi_connection::AccessibilityConnection; let conn = AccessibilityConnection::new().await.unwrap(); let name = UniqueName::from_static_str_unchecked(":1.1"); let path = ObjectPath::from_static_str_unchecked("/org/freedesktop/accessible/root"); let object_ref = ObjectRef::new_owned(name, path); let accessible_proxy = conn.object_as_accessible(&object_ref).await; assert!( accessible_proxy.is_ok(), "Failed to get accessible proxy: {:?}", accessible_proxy.err() ); ``` -------------------------------- ### Implementations of DBusMatchRule Source: https://docs.rs/atspi/0.29.0/atspi/events/trait.DBusMatchRule.html Provides examples of how the DBusMatchRule trait is implemented for various event types, each defining a specific DBus match rule string. ```APIDOC ### impl DBusMatchRule for CacheEvents #### const MATCH_RULE_STRING: &'static str = "type='signal',interface='org.a11y.atspi.Cache'" ### impl DBusMatchRule for DocumentEvents #### const MATCH_RULE_STRING: &'static str = "type='signal',interface='org.a11y.atspi.Event.Document'" ### impl DBusMatchRule for EventListenerEvents #### const MATCH_RULE_STRING: &'static str = "type='signal',interface='org.a11y.atspi.Registry'" ### impl DBusMatchRule for FocusEvents #### const MATCH_RULE_STRING: &'static str = "type='signal',interface='org.a11y.atspi.Event.Focus'" ### impl DBusMatchRule for KeyboardEvents #### const MATCH_RULE_STRING: &'static str = "type='signal',interface='org.a11y.atspi.Event.Keyboard'" ### impl DBusMatchRule for MouseEvents #### const MATCH_RULE_STRING: &'static str = "type='signal',interface='org.a11y.atspi.Event.Mouse'" ### impl DBusMatchRule for ObjectEvents #### const MATCH_RULE_STRING: &'static str = "type='signal',interface='org.a11y.atspi.Event.Object'" ### impl DBusMatchRule for TerminalEvents #### const MATCH_RULE_STRING: &'static str = "type='signal',interface='org.a11y.atspi.Event.Terminal'" ### impl DBusMatchRule for WindowEvents #### const MATCH_RULE_STRING: &'static str = "type='signal',interface='org.a11y.atspi.Event.Window'" ### impl DBusMatchRule for AddAccessibleEvent #### const MATCH_RULE_STRING: &'static str = "type='signal',interface='org.a11y.atspi.Cache',member='AddAccessible'" ### impl DBusMatchRule for LegacyAddAccessibleEvent #### const MATCH_RULE_STRING: &'static str = "type='signal',interface='org.a11y.atspi.Cache',member='AddAccessible'" ### impl DBusMatchRule for RemoveAccessibleEvent #### const MATCH_RULE_STRING: &'static str = "type='signal',interface='org.a11y.atspi.Cache',member='RemoveAccessible'" ### impl DBusMatchRule for atspi::events::document::AttributesChangedEvent #### const MATCH_RULE_STRING: &'static str = "type='signal',interface='org.a11y.atspi.Event.Document',member='AttributesChanged'" ### impl DBusMatchRule for ContentChangedEvent #### const MATCH_RULE_STRING: &'static str = "type='signal',interface='org.a11y.atspi.Event.Document',member='ContentChanged'" ### impl DBusMatchRule for LoadCompleteEvent #### const MATCH_RULE_STRING: &'static str = "type='signal',interface='org.a11y.atspi.Event.Document',member='LoadComplete'" ### impl DBusMatchRule for LoadStoppedEvent #### const MATCH_RULE_STRING: &'static str = "type='signal',interface='org.a11y.atspi.Event.Document',member='LoadStopped'" ### impl DBusMatchRule for PageChangedEvent #### const MATCH_RULE_STRING: &'static str = "type='signal',interface='org.a11y.atspi.Event.Document',member='PageChanged'" ### impl DBusMatchRule for ReloadEvent #### const MATCH_RULE_STRING: &'static str = "type='signal',interface='org.a11y.atspi.Event.Document',member='LoadStopped'" ### impl DBusMatchRule for FocusEvent #### const MATCH_RULE_STRING: &'static str = "type='signal',interface='org.a11y.atspi.Event.Focus',member='Focus'" ### impl DBusMatchRule for ModifiersEvent #### const MATCH_RULE_STRING: &'static str = "type='signal',interface='org.a11y.atspi.Event.Keyboard',member='Modifiers'" ### impl DBusMatchRule for AbsEvent #### const MATCH_RULE_STRING: &'static str = "type='signal',interface='org.a11y.atspi.Event.Mouse',member='Abs'" ### impl DBusMatchRule for ButtonEvent #### const MATCH_RULE_STRING: &'static str = "type='signal',interface='org.a11y.atspi.Event.Mouse',member='Button'" ### impl DBusMatchRule for RelEvent #### const MATCH_RULE_STRING: &'static str = "type='signal',interface='org.a11y.atspi.Event.Mouse',member='Rel'" ### impl DBusMatchRule for ActiveDescendantChangedEvent #### const MATCH_RULE_STRING: &'static str = "type='signal',interface='org.a11y.atspi.Event.Object',member='ActiveDescendantChanged'" ``` -------------------------------- ### Create an empty StateSet Source: https://docs.rs/atspi/0.29.0/atspi/state/struct.StateSet.html Initializes an empty `StateSet` with no states set. This is useful for starting with a clean slate before inserting specific states. ```rust let empty_set = StateSet::empty(); assert!(empty_set.is_empty()); ``` -------------------------------- ### Handling File Metadata Operations with and_then Source: https://docs.rs/atspi/0.29.0/atspi/type.Result.html Demonstrates chaining fallible file system operations like getting metadata and modified time. `and_then` is used here to propagate errors, such as when a path does not exist. ```rust use std::{io::ErrorKind, path::Path}; // Note: on Windows "/" maps to "C:\\" let root_modified_time = Path::new("/").metadata().and_then(|md| md.modified()); assert!(root_modified_time.is_ok()); let should_fail = Path::new("/bad/path").metadata().and_then(|md| md.modified()); assert!(should_fail.is_err()); assert_eq!(should_fail.unwrap_err().kind(), ErrorKind::NotFound); ``` -------------------------------- ### InterfaceSet Conversion and Default Source: https://docs.rs/atspi/0.29.0/atspi/interface/struct.InterfaceSet.html Explains how to create an InterfaceSet from other types and its default state. ```APIDOC ## InterfaceSet Conversion and Default ### `From` Creates an `InterfaceSet` containing a single specified `Interface`. ### `FromIterator<&Interface>` and `FromIterator` Creates an `InterfaceSet` from an iterator of `Interface`s. ### `Default` Provides a default empty `InterfaceSet`. ``` -------------------------------- ### type_id Source: https://docs.rs/atspi/0.29.0/atspi/interface/struct.InterfaceSet.html Gets the `TypeId` of `self`. ```APIDOC ## fn type_id(&self) -> TypeId Gets the `TypeId` of `self`. Read more ``` -------------------------------- ### Cloning and Initialization Source: https://docs.rs/atspi/0.29.0/atspi/events/event_body/struct.EventBodyQtBorrowed.html Includes methods for cloning to uninitialized memory and creating owned data from borrowed data. ```APIDOC ## unsafe fn clone_to_uninit(&self, dest: *mut u8) ### Description Performs copy-assignment from `self` to `dest`. This is a nightly-only experimental API. ### Method `clone_to_uninit` ### Parameters - `dest` (*mut u8): A mutable pointer to the destination memory. ### Safety This function is unsafe as it involves raw pointer manipulation. ``` ```APIDOC ## fn to_owned(&self) -> T ### Description Creates owned data from borrowed data, usually by cloning. ### Method `to_owned` ### Parameters None ### Returns `T`: An owned version of the data. ``` ```APIDOC ## fn clone_into(&self, target: &mut T) ### Description Uses borrowed data to replace owned data, usually by cloning. ### Method `clone_into` ### Parameters - `target` (&mut T): A mutable reference to the owned data to be updated. ``` -------------------------------- ### deserializer_for_signature Source: https://docs.rs/atspi/0.29.0/atspi/interface/struct.InterfaceSet.html Get a deserializer compatible with this parsed signature. ```APIDOC ## fn deserializer_for_signature( signature: &Signature, ) -> Result<>::Deserializer, Error> Get a deserializer compatible with this parsed signature. ``` -------------------------------- ### TryFrom for DesktopCreateEvent Source: https://docs.rs/atspi/0.29.0/atspi/enum.Event.html Converts a generic Event into a DesktopCreateEvent. Returns an AtspiError on failure. ```APIDOC ## TryFrom for DesktopCreateEvent ### Description Performs the conversion from a generic `Event` to a `DesktopCreateEvent`. ### Method try_from ### Parameters - **generic_event** (Event) - The event to convert. ### Returns - Result - A Result containing either the `DesktopCreateEvent` or an `AtspiError`. ``` -------------------------------- ### Get Event Body Source: https://docs.rs/atspi/0.29.0/atspi/events/window/struct.ResizeEvent.html Retrieves the body of the ResizeEvent. ```rust fn body(&self) -> >::Body<'_> ``` -------------------------------- ### Get LowerEvent Body Source: https://docs.rs/atspi/0.29.0/atspi/events/window/struct.LowerEvent.html Retrieves the body of the LowerEvent. ```rust fn body(&self) -> >::Body<'_> ``` -------------------------------- ### TryFrom for DesktopCreateEvent Source: https://docs.rs/atspi/0.29.0/atspi/events/event_wrappers/enum.Event.html Converts a generic Event into a DesktopCreateEvent. Returns an error if the conversion fails. ```APIDOC ## fn try_from( generic_event: Event, ) -> Result>::Error> ### Description Performs the conversion. ### Method TryFrom ### Parameters #### Path Parameters - **generic_event** (Event) - Required - The generic event to convert. ### Response #### Success Response - **DesktopCreateEvent** - The converted DesktopCreateEvent if successful. #### Error Response - **AtspiError** - The error type returned if conversion fails. ``` -------------------------------- ### Any for T Source: https://docs.rs/atspi/0.29.0/atspi/events/struct.EventBodyQtOwned.html Provides the `type_id` method to get the TypeId of an object. ```APIDOC ## fn type_id(&self) -> TypeId Gets the `TypeId` of `self`. ``` -------------------------------- ### Basic Result Usage Source: https://docs.rs/atspi/0.29.0/atspi/type.Result.html Demonstrates the basic usage of Result with Ok and asserts the unwrapped value. ```rust let x: Result = Ok(2); assert_eq!(x.unwrap(), 2); ``` -------------------------------- ### try_from Source: https://docs.rs/atspi/0.29.0/atspi/struct.InterfaceSet.html Performs the conversion. ```APIDOC ## fn try_from(value: U) -> Result>::Error> ### Description Performs the conversion. ### Parameters - `value` (*U*) ### Returns - `Result>::Error>` ``` -------------------------------- ### Get Event Body Source: https://docs.rs/atspi/0.29.0/atspi/events/registry/struct.EventListenerRegisteredEvent.html Retrieves the body of the EventListenerRegisteredEvent, which is of type EventListeners. ```rust fn body( &self, ) -> >::Body<'_> ``` -------------------------------- ### TryFrom for DesktopDestroyEvent Source: https://docs.rs/atspi/0.29.0/atspi/events/event_wrappers/enum.Event.html Converts a generic Event into a DesktopDestroyEvent. Returns an error if the conversion fails. ```APIDOC ## fn try_from( generic_event: Event, ) -> Result>::Error> ### Description Performs the conversion. ### Method TryFrom ### Parameters #### Path Parameters - **generic_event** (Event) - Required - The generic event to convert. ### Response #### Success Response - **DesktopDestroyEvent** - The converted DesktopDestroyEvent if successful. #### Error Response - **AtspiError** - The error type returned if conversion fails. ``` -------------------------------- ### impl DynamicType for T Source: https://docs.rs/atspi/0.29.0/atspi/struct.ObjectRefOwned.html Provides a way to get the type signature for a given type. ```APIDOC ## fn signature(&self) -> Signature ### Description The type signature for `self`. ### Method GET ### Endpoint /signature ### Response #### Success Response (200) - **signature** (Signature) - The type signature. ``` -------------------------------- ### detail2() - Get EventBody detail2 Source: https://docs.rs/atspi/0.29.0/atspi/events/enum.EventBody.html Retrieves the `detail2` field, which is an `i32` value. ```rust pub fn detail2(&self) -> i32 ``` -------------------------------- ### TryFrom for DesktopDestroyEvent Source: https://docs.rs/atspi/0.29.0/atspi/enum.Event.html Converts a generic Event into a DesktopDestroyEvent. Returns an AtspiError on failure. ```APIDOC ## TryFrom for DesktopDestroyEvent ### Description Performs the conversion from a generic `Event` to a `DesktopDestroyEvent`. ### Method try_from ### Parameters - **generic_event** (Event) - The event to convert. ### Returns - Result - A Result containing either the `DesktopDestroyEvent` or an `AtspiError`. ``` -------------------------------- ### detail1() - Get EventBody detail1 Source: https://docs.rs/atspi/0.29.0/atspi/events/enum.EventBody.html Retrieves the `detail1` field, which is an `i32` value. ```rust pub fn detail1(&self) -> i32 ``` -------------------------------- ### InterfaceSet::all Source: https://docs.rs/atspi/0.29.0/atspi/struct.InterfaceSet.html Creates an InterfaceSet containing all possible interfaces. ```APIDOC ## InterfaceSet::all ### Description Creates an InterfaceSet containing all possible interfaces. ### Signature ```rust pub fn all() -> InterfaceSet ``` ``` -------------------------------- ### WindowEvents Conversions Source: https://docs.rs/atspi/0.29.0/atspi/events/enum.WindowEvents.html Demonstrates the conversion implementations for WindowEvents from various specific event types like MinimizeEvent, MoveEvent, PropertyChangeEvent, RaiseEvent, ReparentEvent, ResizeEvent, RestoreEvent, RestyleEvent, ShadeEvent, and UUshadeEvent. It also shows the conversion to the generic Event type. ```APIDOC ## WindowEvents Conversions ### `impl From for WindowEvents` #### `fn from(specific_event: MinimizeEvent) -> WindowEvents` Converts to this type from the input type. ### `impl From for WindowEvents` #### `fn from(specific_event: MoveEvent) -> WindowEvents` Converts to this type from the input type. ### `impl From for WindowEvents` #### `fn from(specific_event: PropertyChangeEvent) -> WindowEvents` Converts to this type from the input type. ### `impl From for WindowEvents` #### `fn from(specific_event: RaiseEvent) -> WindowEvents` Converts to this type from the input type. ### `impl From for WindowEvents` #### `fn from(specific_event: ReparentEvent) -> WindowEvents` Converts to this type from the input type. ### `impl From for WindowEvents` #### `fn from(specific_event: ResizeEvent) -> WindowEvents` Converts to this type from the input type. ### `impl From for WindowEvents` #### `fn from(specific_event: RestoreEvent) -> WindowEvents` Converts to this type from the input type. ### `impl From for WindowEvents` #### `fn from(specific_event: RestyleEvent) -> WindowEvents` Converts to this type from the input type. ### `impl From for WindowEvents` #### `fn from(specific_event: ShadeEvent) -> WindowEvents` Converts to this type from the input type. ### `impl From for WindowEvents` #### `fn from(specific_event: UUshadeEvent) -> WindowEvents` Converts to this type from the input type. ### `impl From for Event` #### `fn from(event_variant: WindowEvents) -> Event` Converts to this type from the input type. ### `impl TryFrom<&Message> for WindowEvents` #### `type Error = AtspiError` The type returned in the event of a conversion error. #### `fn try_from( msg: &Message, ) -> Result>::Error>` Performs the conversion. ### `impl TryFrom for WindowEvents` #### `type Error = AtspiError` The type returned in the event of a conversion error. #### `fn try_from( generic_event: Event, ) -> Result>::Error>` Performs the conversion. ``` -------------------------------- ### Get ObjectRef Path Source: https://docs.rs/atspi/0.29.0/atspi/enum.ObjectRef.html The `path` method returns a reference to the `ObjectPath` of the `ObjectRef`. ```rust use zbus::names::UniqueName; use zbus::zvariant::ObjectPath; use atspi_common::ObjectRef; let name = UniqueName::from_static_str_unchecked(":1.23"); let path = ObjectPath::from_static_str_unchecked("/org/a11y/example/path/007"); let object_ref = ObjectRef::new_borrowed(name, path); // Check the path of the object reference assert_eq!(object_ref.path().as_str(), "/org/a11y/example/path/007"); ``` -------------------------------- ### from Source: https://docs.rs/atspi/0.29.0/atspi/events/enum.EventBody.html Creates a new instance of the type by taking ownership of the argument. ```APIDOC ## fn from(t: T) -> T ### Description Returns the argument unchanged. ### Parameters - **t** (T) - The value to convert. ### Response #### Success Response - **T** - The unchanged value. ``` -------------------------------- ### Get Inner Zbus Proxy Source: https://docs.rs/atspi/0.29.0/atspi/struct.AccessibilityConnection.html Returns a reference to the underlying `zbus::Proxy` object. ```rust pub fn inner(&self) -> &Proxy<'p> ``` -------------------------------- ### DesktopCreateEvent Registry Event String Source: https://docs.rs/atspi/0.29.0/atspi/events/window/struct.DesktopCreateEvent.html Defines the constant string used for registering DesktopCreateEvent. ```APIDOC ## const REGISTRY_EVENT_STRING: &'static str = "window:desktop-create" A registry event string for registering for event receiving via the `RegistryProxy`. This should be deprecated in favour of composing the string from `DBusMember::DBUS_MEMBER` and `DBusInterface::DBUS_INTERFACE`. ``` -------------------------------- ### Get Underlying Zbus Connection Source: https://docs.rs/atspi/0.29.0/atspi/struct.AccessibilityConnection.html Provides a shorthand reference to the underlying `zbus::Connection` object. ```rust pub fn connection(&self) -> &Connection ``` -------------------------------- ### Create and Convert ObjectRef Source: https://docs.rs/atspi/0.29.0/atspi/enum.ObjectRef.html Demonstrates creating an ObjectRef from a unique name and object path, and converting it into an owned version. Use this when you need to manage the ownership of the object reference. ```rust use zbus::names::UniqueName; use zbus::zvariant::ObjectPath; use atspi_common::ObjectRef; let name = UniqueName::from_static_str_unchecked(":1.23"); let path = ObjectPath::from_static_str_unchecked("/org/a11y/example/path/007"); let object_ref = ObjectRef::new_borrowed(name, path); // Check whether the object reference can be converted to an owned version assert!(!object_ref.is_null()); let object_ref = object_ref.into_owned(); assert!(matches!(object_ref, ObjectRef::Owned { .. })); ``` -------------------------------- ### Get the path of the ObjectRefOwned Source: https://docs.rs/atspi/0.29.0/atspi/object_ref/struct.ObjectRefOwned.html Returns a reference to the object path of the reference. For a Null reference, it returns the null-path. ```rust pub fn path(&self) -> &ObjectPath<'static> ``` -------------------------------- ### Get the path as a string slice Source: https://docs.rs/atspi/0.29.0/atspi/object_ref/struct.ObjectRefOwned.html Returns the path of the object reference as a string slice. For a Null reference, this will be the null-path. ```rust pub fn path_as_str(&self) -> &str ``` -------------------------------- ### CloneToUninit (Nightly Only) Source: https://docs.rs/atspi/0.29.0/atspi/enum.CacheEvents.html Performs copy-assignment from `self` to a destination pointer. This is an experimental API and requires a nightly Rust toolchain. ```APIDOC ## unsafe fn clone_to_uninit(&self, dest: *mut u8) ### Description Performs copy-assignment from `self` to `dest`. ### Method `clone_to_uninit` ### Parameters - **dest** (*mut u8): A mutable pointer to the destination memory. ### Safety This function is unsafe because it operates on raw pointers and assumes the destination is valid and sufficiently large. ``` -------------------------------- ### Creating a Full Interface Set Source: https://docs.rs/atspi/0.29.0/atspi/enum.Interface.html Creates a BitFlags with all flags set, representing an object that implements all possible AT-SPI interfaces. ```rust fn all() -> BitFlags ``` -------------------------------- ### Get the name of the ObjectRefOwned Source: https://docs.rs/atspi/0.29.0/atspi/object_ref/struct.ObjectRefOwned.html Retrieves the name of the object reference. Returns None if the reference is Null, otherwise returns the name. ```rust pub fn name(&self) -> Option<&UniqueName<'static>> ``` -------------------------------- ### From for AtspiError Source: https://docs.rs/atspi/0.29.0/atspi/enum.AtspiError.html Demonstrates the conversion of a TryFromIntError into an AtspiError. ```APIDOC ## fn from(e: TryFromIntError) -> AtspiError ### Description Converts to this type from the input type. ``` -------------------------------- ### Consume ObjectRefOwned to get inner ObjectRef Source: https://docs.rs/atspi/0.29.0/atspi/object_ref/struct.ObjectRefOwned.html This method consumes the ObjectRefOwned instance and returns its inner ObjectRef<'static> value. ```rust pub fn into_inner(self) -> ObjectRef<'static> ``` -------------------------------- ### Blanket Implementations Source: https://docs.rs/atspi/0.29.0/atspi/events/enum.ObjectEvents.html Details various blanket implementations available for ObjectEvents, such as Any, Borrow, CloneToUninit, From, Instrument, Into, ToOwned, TryFrom, TryInto, VZip, and WithSubscriber. ```APIDOC ## Blanket Implementations ### impl Any for T #### fn type_id(&self) -> TypeId Gets the `TypeId` of `self`. Read more ### impl Borrow for T #### fn borrow(&self) -> &T Immutably borrows from an owned value. Read more ### impl BorrowMut for T #### fn borrow_mut(&mut self) -> &mut T Mutably borrows from an owned value. Read more ### impl CloneToUninit for T #### unsafe fn clone_to_uninit(&self, dest: *mut u8) Performs copy-assignment from `self` to `dest`. Read more ### impl From for T #### fn from(t: T) -> T Returns the argument unchanged. ### impl Instrument for T #### fn instrument(self, span: Span) -> Instrumented Instruments this type with the provided `Span`, returning an `Instrumented` wrapper. Read more #### fn in_current_span(self) -> Instrumented Instruments this type with the current `Span`, returning an `Instrumented` wrapper. Read more ### impl Into for T #### fn into(self) -> U Calls `U::from(self)`. That is, this conversion is whatever the implementation of `From for U` chooses to do. ### impl ToOwned for T #### type Owned = T The resulting type after obtaining ownership. #### fn to_owned(&self) -> T Creates owned data from borrowed data, usually by cloning. Read more #### fn clone_into(&self, target: &mut T) Uses borrowed data to replace owned data, usually by cloning. Read more ### impl TryFrom for T #### type Error = Infallible The type returned in the event of a conversion error. #### fn try_from(value: U) -> Result>::Error> Performs the conversion. ### impl TryInto for T #### type Error = >::Error The type returned in the event of a conversion error. #### fn try_into(self) -> Result>::Error> Performs the conversion. ### impl VZip for T #### fn vzip(self) -> V ### impl WithSubscriber for T #### fn with_subscriber(self, subscriber: S) -> WithDispatch Attaches the provided `Subscriber` to this type, returning a `WithDispatch` wrapper. Read more #### fn with_current_subscriber(self) -> WithDispatch Attaches the current default `Subscriber` to this type, returning a `WithDispatch` wrapper. Read more ### impl DeserializeOwned for T ``` -------------------------------- ### ReloadEvent Source: https://docs.rs/atspi/0.29.0/atspi/events/document/struct.ReloadEvent.html Represents an event triggered by a reloading of a document. For example, pressing F5 or Control+R will reload a page in a web browser. ```APIDOC ## Struct ReloadEvent ### Summary ``` pub struct ReloadEvent { pub item: ObjectRefOwned, } ``` ### Fields * `item: ObjectRefOwned` - The `crate::ObjectRef` which the event applies to. ``` -------------------------------- ### Into Source: https://docs.rs/atspi/0.29.0/atspi/struct.LegacyCacheItem.html Provides a conversion from one type to another if the target type implements `From`. ```APIDOC ### impl Into for T where U: From #### fn into(self) -> U ### Description Calls `U::from(self)`. That is, this conversion is whatever the implementation of `From for U` chooses to do. ### Returns U ``` -------------------------------- ### fn report(self) -> ExitCode Source: https://docs.rs/atspi/0.29.0/atspi/type.Result.html Is called to get the representation of the value as status code. This status code is returned to the operating system. ```APIDOC ## fn report(self) -> ExitCode ### Description Is called to get the representation of the value as status code. This status code is returned to the operating system. ``` -------------------------------- ### Get the name as a string slice Source: https://docs.rs/atspi/0.29.0/atspi/object_ref/struct.ObjectRefOwned.html Returns the name of the object reference directly as a string slice. Returns None if the reference is Null. ```rust pub fn name_as_str(&self) -> Option<&str> ``` -------------------------------- ### into_ok Source: https://docs.rs/atspi/0.29.0/atspi/type.Result.html Returns the contained Ok value, but never panics. This is an experimental API. ```APIDOC ## into_ok ### Description Returns the contained `Ok` value, but never panics. This is a nightly-only experimental API. Unlike `unwrap`, this method is known to never panic on the result types it is implemented for. Therefore, it can be used instead of `unwrap` as a maintainability safeguard that will fail to compile if the error type of the `Result` is later changed to an error that can actually occur. ### Method `into_ok()` ### Parameters None ### Response #### Success Response (T) - Returns the contained `Ok` value of type `T`. #### Response Example ```rust fn only_good_news() -> Result { Ok("this is fine".into()) } let s: String = only_good_news().into_ok(); println!("{s}"); ``` ``` -------------------------------- ### TryFrom> for ObjectRefOwned Source: https://docs.rs/atspi/0.29.0/atspi/object_ref/struct.ObjectRefOwned.html Implementation of TryFrom for converting from AccessibleProxy to ObjectRefOwned. ```APIDOC ## impl TryFrom> for ObjectRefOwned ### type Error = AtspiError The type returned in the event of a conversion error. ### fn try_from( proxy: AccessibleProxy<'_>, ) -> Result>>::Error> Performs the conversion. ``` -------------------------------- ### Get StateSet bits Source: https://docs.rs/atspi/0.29.0/atspi/state/struct.StateSet.html Retrieves the underlying `u64` representation of the `StateSet`. This can be useful for debugging or when interacting with systems that expect a raw bitmask. ```rust let set = StateSet::new(State::Active); let bits = set.bits(); assert_eq!(bits, 1 << State::Active as u8); ``` -------------------------------- ### ReparentEvent Type Properties Source: https://docs.rs/atspi/0.29.0/atspi/events/window/struct.ReparentEvent.html Provides methods to get the event type's member, interface, registry string, and match rule. ```APIDOC ## ReparentEvent Type Properties ### `EventTypeProperties` Implementation ```rust fn member(&self) -> &'static str fn interface(&self) -> &'static str fn registry_string(&self) -> &'static str fn match_rule(&self) -> &'static str ``` These methods return static string slices representing the event's D-Bus member, interface, registry string, and match rule. ``` -------------------------------- ### From Source: https://docs.rs/atspi/0.29.0/atspi/enum.CacheEvents.html Provides a way to create `CacheEvents` from itself. ```APIDOC ## fn from(t: T) -> T ### Description Returns the argument unchanged. ### Method `from` ### Parameters - **t** (T): The value to convert. ### Response - **T**: The converted value. ``` -------------------------------- ### CloseEvent Event Type Properties Source: https://docs.rs/atspi/0.29.0/atspi/events/window/struct.CloseEvent.html Provides methods to get the event type, interface, registry string, and match rule for the CloseEvent. ```APIDOC ## CloseEvent Event Type Properties ### `EventTypeProperties` Implementation ```rust fn member(&self) -> &'static str fn interface(&self) -> &'static str fn registry_string(&self) -> &'static str fn match_rule(&self) -> &'static str ``` ### Description Returns the event member name, interface name, registry string, and D-Bus match rule string. ``` -------------------------------- ### try_into Source: https://docs.rs/atspi/0.29.0/atspi/struct.InterfaceSet.html Performs the conversion. ```APIDOC ## fn try_into(self) -> Result>::Error> ### Description Performs the conversion. ### Parameters - `self` (*self*) ### Returns - `Result>::Error>` ``` -------------------------------- ### any_data() - Get EventBody any_data as &Value Source: https://docs.rs/atspi/0.29.0/atspi/events/enum.EventBody.html Returns a reference to the `any_data` field, which is of type `&Value`. This method is applicable to both `Owned` and `Borrowed` variants. ```rust pub fn any_data(&'a self) -> &'a Value<'a> ``` -------------------------------- ### vzip Method Source: https://docs.rs/atspi/0.29.0/atspi/enum.CoordType.html Zips multiple lanes together. ```APIDOC ### impl VZip for T where V: MultiLane, #### fn vzip(self) -> V ``` -------------------------------- ### Registry Event String Source: https://docs.rs/atspi/0.29.0/atspi/events/enum.MouseEvents.html Provides a static string for registering mouse events with the RegistryProxy. ```APIDOC ### impl RegistryEventString for MouseEvents ```rust const REGISTRY_EVENT_STRING: &'static str = "mouse:"; ``` This static string is used for registering mouse events via the `RegistryProxy`. It is recommended to use composition with `DBusMember::DBUS_MEMBER` and `DBusInterface::DBUS_INTERFACE` for newer implementations. ``` -------------------------------- ### kind() - Get EventBody Kind as &str Source: https://docs.rs/atspi/0.29.0/atspi/events/enum.EventBody.html Returns a reference to the `kind` field as a string slice. This method works identically for both `Owned` and `Borrowed` variants. ```rust pub fn kind(&'a self) -> &'a str ``` -------------------------------- ### Object as AccessibleProxy (P2P) Source: https://docs.rs/atspi/0.29.0/atspi/struct.AccessibilityConnection.html Returns a P2P connected `AccessibleProxy` for the given `ObjectRefOwned`, if available. If the application does not support P2P, an `AccessibleProxy` with a bus connection is returned. ```rust async fn object_as_accessible( &self, obj: &ObjectRefOwned, ) -> Result, AtspiError> ``` -------------------------------- ### Generic Implementations for T Source: https://docs.rs/atspi/0.29.0/atspi/struct.CacheItem.html Demonstrates blanket implementations for generic types, including Any, Borrow, BorrowMut, CloneToUninit, and DynamicDeserialize. ```rust impl Any for T where T: 'static + ?Sized, ``` ```rust fn type_id(&self) -> TypeId ``` ```rust impl Borrow where T: ?Sized, ``` ```rust fn borrow(&self) -> &T ``` ```rust impl BorrowMut where T: ?Sized, ``` ```rust fn borrow_mut(&mut self) -> &mut T ``` ```rust impl CloneToUninit for T where T: Clone, ``` ```rust unsafe fn clone_to_uninit(&self, dest: *mut u8) ``` ```rust impl<'de, T> DynamicDeserialize<'de> where T: Type + Deserialize<'de>, ``` -------------------------------- ### Get Registered Events Source: https://docs.rs/atspi/0.29.0/atspi/struct.AccessibilityConnection.html Retrieves a list of all currently registered events on the accessibility bus. The result is a vector of tuples, each containing an `OwnedBusName` and a `String` representing the event. ```rust pub async fn registered_events( &self, ) -> Result, Error> ``` -------------------------------- ### ActivateEvent Registry Event String Source: https://docs.rs/atspi/0.29.0/atspi/events/window/struct.ActivateEvent.html Provides the constant registry event string for 'window:activate'. This is used for registering event reception via the RegistryProxy. ```APIDOC ## const REGISTRY_EVENT_STRING: &'static str = "window:activate" A registry event string for registering for event receiving via the `RegistryProxy`. This should be deprecated in favour of composing the string from `DBusMember::DBUS_MEMBER` and `DBusInterface::DBUS_INTERFACE`. ``` -------------------------------- ### Event Type Properties for MouseEvents Source: https://docs.rs/atspi/0.29.0/atspi/events/enum.MouseEvents.html Provides methods to get event type specific properties like member, interface, match rule, and registry string. ```APIDOC ### impl EventTypeProperties for MouseEvents * `fn member(&self) -> &'static str`: Returns the D-Bus member name for the event. * `fn interface(&self) -> &'static str`: Returns the D-Bus interface name for the event. * `fn match_rule(&self) -> &'static str`: Returns the D-Bus match rule string for the event. * `fn registry_string(&self) -> &'static str`: Returns the registry string for event receiving. ``` -------------------------------- ### DesktopCreateEvent Equality Source: https://docs.rs/atspi/0.29.0/atspi/events/window/struct.DesktopCreateEvent.html Provides methods for comparing DesktopCreateEvent instances for equality. ```APIDOC ## fn eq(&self, other: &DesktopCreateEvent) -> bool Tests for `self` and `other` values to be equal, and is used by `==`. ``` ```APIDOC ## fn ne(&self, other: &Rhs) -> bool Tests for `!=`. The default implementation is almost always sufficient, and should not be overridden without very good reason. ``` -------------------------------- ### TryFrom<&Header<'_>> for ObjectRefOwned Source: https://docs.rs/atspi/0.29.0/atspi/object_ref/struct.ObjectRefOwned.html Implementation of TryFrom for converting from Header to ObjectRefOwned. ```APIDOC ## impl<'m> TryFrom<&'m Header<'_>> for ObjectRefOwned ### fn try_from( header: &'m Header<'_>, ) -> Result>>::Error> Construct an `ObjectRefOwned` from a `zbus::message::Header`. ### type Error = AtspiError The type returned in the event of a conversion error. ``` -------------------------------- ### Get a Specific Peer by Bus Name Source: https://docs.rs/atspi/0.29.0/atspi/struct.AccessibilityConnection.html Fetches a specific `Peer` object based on its bus name. Returns `None` if no peer with the given bus name is found. ```rust use atspi_connection::{AccessibilityConnection, P2P, Peer}; use zbus::names::BusName; let a11y = AccessibilityConnection::new().await.unwrap(); let bus_name = BusName::from_static_str(":1.42").unwrap(); let peer: Option = a11y.get_peer(&bus_name); ``` -------------------------------- ### Handle Null ObjectRef with AccessibilityConnection Source: https://docs.rs/atspi/0.29.0/atspi/struct.AccessibilityConnection.html Illustrates how to handle a null ObjectRef when attempting to get an AccessibleProxy. This is useful for cases where an object reference might be null, such as from a parent property. ```rust use atspi_proxies::accessible::AccessibleProxy; use atspi_common::{AtspiError, ObjectRef, ObjectRefOwned}; use atspi_connection::P2P; use atspi_connection::AccessibilityConnection; let conn = AccessibilityConnection::new().await.unwrap(); let object_ref = ObjectRef::Null; let object_ref = ObjectRefOwned::new(object_ref); // Assume we received this from `Accessible.Parent` let res = conn.object_as_accessible(&object_ref).await; match res { Ok(proxy) => { // Use the proxy let _proxy: AccessibleProxy<'_> = proxy; } Err(AtspiError::NullRef(_msg)) => { // Handle null-reference case } Err(_other) => { // Handle other error types } } ``` -------------------------------- ### TryFrom<&AccessibleProxy<'_>> for ObjectRefOwned Source: https://docs.rs/atspi/0.29.0/atspi/object_ref/struct.ObjectRefOwned.html Implementation of TryFrom for converting from AccessibleProxy to ObjectRefOwned. ```APIDOC ## impl TryFrom<&AccessibleProxy<'_>> for ObjectRefOwned ### type Error = AtspiError The type returned in the event of a conversion error. ### fn try_from( proxy: &AccessibleProxy<'_>, ) -> Result>>::Error> Performs the conversion. ``` -------------------------------- ### Get mutable references to Result values Source: https://docs.rs/atspi/0.29.0/atspi/type.Result.html Use `as_mut` to obtain a `Result` containing mutable references to the contained values. This allows in-place modification of the `Ok` or `Err` value. ```rust fn mutate(r: &mut Result) { match r.as_mut() { Ok(v) => *v = 42, Err(e) => *e = 0, } } let mut x: Result = Ok(2); mutate(&mut x); assert_eq!(x.unwrap(), 42); let mut x: Result = Err(13); mutate(&mut x); assert_eq!(x.unwrap_err(), 0); ``` -------------------------------- ### DesktopCreateEvent Conversion from Event Source: https://docs.rs/atspi/0.29.0/atspi/events/window/struct.DesktopCreateEvent.html Provides methods to convert a generic `Event` into a `DesktopCreateEvent`. ```APIDOC ## type Error = AtspiError The type returned in the event of a conversion error. ``` ```APIDOC ## fn try_from( generic_event: Event, ) -> Result>::Error> Performs the conversion. ``` -------------------------------- ### LoadCompleteEvent Struct Source: https://docs.rs/atspi/0.29.0/atspi/events/document/struct.LoadCompleteEvent.html Represents an event triggered by the completion of a document load action. For example, a web page has finished loading its initial payload, or LibreOffice has loaded a document from disk. ```APIDOC ## Struct LoadCompleteEvent An event triggered by the completion of a document load action. For example: a web page has finished loading its initial payload, or `LibreOffice` has loaded a document from disk. ### Fields * `item`: `ObjectRefOwned` - The `crate::ObjectRef` which the event applies to. ``` -------------------------------- ### VZip Method Source: https://docs.rs/atspi/0.29.0/atspi/object_ref/enum.ObjectRef.html Provides a method for zipping with a V-lane. ```APIDOC ## fn vzip(self) -> V ### Description Zips the current type with a V-lane. ### Method `vzip` ``` -------------------------------- ### LoadStoppedEvent Struct Source: https://docs.rs/atspi/0.29.0/atspi/events/document/struct.LoadStoppedEvent.html Represents an event triggered by the cancellation of a document load. For example, during the loading of a large web page, a user may press Escape to stop loading the page. ```APIDOC ## Struct LoadStoppedEvent An event triggered by the cancelling of a document load. For example: during the loading of a large web page, a user may press `Escape` to stop loading the page. ### Fields * `item` (`ObjectRefOwned`): The `crate::ObjectRef` which the event applies to. ``` -------------------------------- ### Create AccessibilityConnection from Address Source: https://docs.rs/atspi/0.29.0/atspi/struct.AccessibilityConnection.html Returns an AccessibilityConnection wrapper for the RegistryProxy, useful when the bus address is known. Without an address, use `open`. ```rust pub async fn from_address( bus_addr: Address, ) -> Result ``` -------------------------------- ### Lazily Computing a Default Value with unwrap_or_else Source: https://docs.rs/atspi/0.29.0/atspi/type.Result.html Use `unwrap_or_else` to get the `Ok` value or compute a default value using a closure if the `Result` is `Err`. This is efficient as the closure is only called when needed. ```rust fn count(x: &str) -> usize { x.len() } assert_eq!(Ok(2).unwrap_or_else(count), 2); assert_eq!(Err("foo").unwrap_or_else(count), 3); ``` -------------------------------- ### InterfaceSet::empty Source: https://docs.rs/atspi/0.29.0/atspi/struct.InterfaceSet.html Creates an empty InterfaceSet. ```APIDOC ## InterfaceSet::empty ### Description Creates an empty InterfaceSet. ### Signature ```rust pub fn empty() -> InterfaceSet ``` ``` -------------------------------- ### SelectionChangedEvent Source: https://docs.rs/atspi/0.29.0/atspi/events/object/struct.SelectionChangedEvent.html The SelectionChangedEvent struct indicates that the selection of an accessible object has changed. This event is emitted when, for example, a selection from a series of checkboxes is modified, affecting the state of a child and triggering a SelectionChangedEvent on the parent. ```APIDOC ## Struct SelectionChangedEvent ### Summary ```rust pub struct SelectionChangedEvent { pub item: ObjectRefOwned, } ``` ### Description The selection of this item has changed. For example: when a selection from a series of checkboxes is changed, this will change the state of the child, _and_ cause a `SelectionChangedEvent` on the parent. ### Fields * `item: ObjectRefOwned` - The `crate::ObjectRef` which the event applies to. ``` -------------------------------- ### fn serialize( &self, serializer: S, ) -> Result<::Ok, ::Error> Source: https://docs.rs/atspi/0.29.0/atspi/type.Result.html Serialize this value into the given Serde serializer. ```APIDOC ## fn serialize( &self, serializer: S, ) -> Result<::Ok, ::Error> ### Description Serialize this value into the given Serde serializer. ### Method `serialize` ### Parameters - `serializer`: The Serde serializer to use. ``` -------------------------------- ### Providing a Default Value with unwrap_or Source: https://docs.rs/atspi/0.29.0/atspi/type.Result.html Use `unwrap_or` to get the `Ok` value or a provided default if the `Result` is `Err`. Note that the default value is eagerly evaluated, so `unwrap_or_else` is preferred for lazy evaluation. ```rust let default = 2; let x: Result = Ok(9); assert_eq!(x.unwrap_or(default), 9); let x: Result = Err("error"); assert_eq!(x.unwrap_or(default), default); ``` -------------------------------- ### TryInto Source: https://docs.rs/atspi/0.29.0/atspi/struct.LegacyCacheItem.html Provides a fallible conversion from one type to another. ```APIDOC ### impl TryInto for T where U: TryFrom #### type Error = >::Error #### fn try_into(self) -> Result>::Error> ### Description Performs the conversion. ### Returns Result>::Error> ``` -------------------------------- ### clone_to_uninit Source: https://docs.rs/atspi/0.29.0/atspi/enum.FocusEvents.html Performs copy-assignment from `self` to `dest`. This is a nightly-only experimental API. ```APIDOC ## unsafe fn clone_to_uninit(&self, dest: *mut u8) ### Description Performs copy-assignment from `self` to `dest`. ### Method unsafe fn ### Parameters #### Path Parameters - **dest** (*mut u8) - Required - The destination pointer. ``` -------------------------------- ### fn from_output(output: as Try>::Output) -> Result Source: https://docs.rs/atspi/0.29.0/atspi/type.Result.html Constructs the type from its `Output` type. ```APIDOC ## fn from_output(output: as Try>::Output) -> Result ### Description Constructs the type from its `Output` type. ``` -------------------------------- ### Get references to Result values Source: https://docs.rs/atspi/0.29.0/atspi/type.Result.html Use `as_ref` to obtain a `Result` containing references to the contained values, leaving the original `Result` unchanged. This is useful when you need to inspect the values without taking ownership. ```rust let x: Result = Ok(2); assert_eq!(x.as_ref(), Ok(&2)); let x: Result = Err("Error"); assert_eq!(x.as_ref(), Err(&"Error")); ```