Expand description
xa11y — Cross-Platform Accessibility Client Library
Provides a unified API for reading and interacting with accessibility trees across desktop platforms (macOS, Windows, Linux).
§Quick Start
use xa11y::*;
let provider = create_provider().expect("Failed to create provider");
let status = provider.check_permissions().expect("Permission check failed");
match status {
PermissionStatus::Granted => {
let tree = provider.get_app_tree(
&AppTarget::ByName("Safari".to_string()),
&QueryOptions::default(),
).expect("Failed to get tree");
let buttons = tree.query("button").expect("Query failed");
println!("Found {} buttons", buttons.len());
}
PermissionStatus::Denied { instructions } => {
eprintln!("Accessibility not enabled: {}", instructions);
}
}Modules§
- action
- error
- event
- event_
provider - locator
- node
- provider
- role
- selector
- CSS-like selector parser and matcher for accessibility tree queries.
- tree
Structs§
- AppInfo
- Information about a running application.
- Cancel
Handle - Handle to cancel a subscription. Dropping this stops event delivery.
- Event
- An accessibility event delivered to subscribers.
- Event
Filter - Filter to narrow which events are delivered.
- Event
Receiver - Platform-agnostic event receiver.
- Locator
- A lazy element descriptor that re-resolves against a fresh accessibility tree snapshot on every operation.
- Node
- A single element in the accessibility tree snapshot.
- Query
Options - Options controlling tree traversal and content.
- Rect
- Screen-pixel bounding rectangle (origin + size).
x/yare signed to support negative multi-monitor coordinates.width/heightare unsigned (always non-negative). - State
Set - Boolean state flags for a node.
- Subscription
- A live event subscription. Drop to unsubscribe.
- Text
Change Data - Details about a text change event.
- Tree
- A snapshot of an application’s accessibility tree.
Enums§
- Action
- A normalized enum of interactions that can be performed on accessibility elements.
- Action
Data - Data associated with an action.
- AppTarget
- Target for identifying an application.
- Element
State - Desired element state for wait_for operations.
- Error
- Structured error type for xa11y operations. Designed to be informative across FFI boundaries.
- Event
Kind - Categories of accessibility events, normalized across platforms.
- Permission
Status - Result of a permission check.
- RawPlatform
Data - Platform-specific raw data attached to every node.
- Role
- A normalized enum covering UI element types across all platforms. Derived from ARIA roles, scoped to roles commonly surfaced by real desktop applications.
- Scroll
Direction - Direction for scroll actions.
- State
Flag - Individual state flags, for use in StateChanged events and filters.
- Text
Change Type - The type of text modification.
- Toggled
- Tri-state toggle value.
- Window
Handle - Platform-specific window handle.
Traits§
- Event
Provider - Optional trait for backends that support event subscriptions. Extends Provider with reactive capabilities.
- Provider
- Platform backend trait for accessibility tree access.
- Provider
Ext - Extension trait to create Locators directly from a Provider.
Functions§
- create_
event_ provider - Create a platform-appropriate event provider (supports subscribe/wait).
- create_
provider - Create a platform-appropriate accessibility provider.
Type Aliases§
- Result
- Result type alias for xa11y operations.