Skip to main content

LinuxBackend

Struct LinuxBackend 

Source
pub struct LinuxBackend { /* private fields */ }
Available on Linux only.
Expand description

The Linux implementation of Backend, built on AT-SPI.

Implementations§

Source§

impl LinuxBackend

Source

pub fn new() -> Result<Self>

Connects to the AT-SPI accessibility bus.

Session variables this process lacks (DISPLAY, DBUS_SESSION_BUS_ADDRESS, XAUTHORITY, XDG_RUNTIME_DIR, AT_SPI_BUS_ADDRESS, …) are discovered from the user’s running desktop processes, so the backend also works from services, cron jobs and SSH sessions.

Also turns on the desktop’s accessibility flag (org.a11y.Status.IsEnabled), which some apps need in order to expose their UI. Apps of that kind that were already running before the flag was on must be restarted to show up.

§Errors

Fails if there is no D-Bus session or the accessibility bus is not running.

Trait Implementations§

Source§

impl Backend for LinuxBackend

Source§

type Handle = LinuxElement

Handle to a live accessibility element (e.g. AXUIElement, IUIAutomationElement).
Source§

fn list_apps(&self) -> Result<Vec<AppInfo>>

Running apps plus installed apps the user can launch. Read more
Source§

fn launch_app(&self, app: &AppInfo) -> Result<AppInfo>

Starts app without bringing it to the foreground and returns its running record. Read more
Source§

fn list_windows(&self, app: &AppInfo) -> Result<Vec<WindowInfo>>

The app’s windows, front to back where the platform knows the order. Each one with an id can be passed back as CaptureRequest::window. Read more
Source§

fn capture( &self, app: &AppInfo, request: &CaptureRequest, ) -> Result<Capture<Self::Handle>>

Captures the app’s current window, or the one CaptureRequest::window names. Read more
Source§

fn perform_action(&self, element: &Self::Handle, action: &str) -> Result<()>

Invokes a named accessibility action (as listed in Action::name). Read more
Source§

fn set_value(&self, element: &Self::Handle, value: &str) -> Result<()>

Writes an element’s value. Read more
Source§

fn value(&self, element: &Self::Handle) -> Result<Option<String>>

Reads an element’s full, untruncated value. Read more
Source§

fn select_text( &self, element: &Self::Handle, value: &str, range: Range<usize>, ) -> Result<()>

Selects range (byte offsets into value, the element’s current value). An empty range places the caret. Read more
Source§

fn click( &self, _target: InputTarget<'_>, point: Point, button: MouseButton, count: u32, ) -> Result<()>

Clicks count times at a screen point. Read more
Source§

fn scroll( &self, _target: InputTarget<'_>, point: Point, dx: f64, dy: f64, ) -> Result<()>

Scrolls at a screen point by (dx, dy) points; positive dy reveals content below. Read more
Source§

fn drag(&self, _target: InputTarget<'_>, from: Point, to: Point) -> Result<()>

Presses the primary button at from, moves to to, and releases. Read more
Source§

fn type_text(&self, _target: InputTarget<'_>, text: &str) -> Result<()>

Types literal text. Read more
Source§

fn press_key(&self, _target: InputTarget<'_>, chord: &KeyChord) -> Result<()>

Presses and releases a key chord. Read more
Source§

fn permissions(&self) -> Permissions

Permissions currently held by this process.
Source§

fn request_permissions(&self) -> Permissions

Asks the OS to prompt the user for missing permissions, then reports the current state.
Source§

fn insert_text(&self, app: &AppInfo, text: &str) -> Result<bool>

Inserts text at the caret of the focused element without synthesizing keystrokes. Returns Ok(false) when the focused element does not support it, so the caller can fall back to Backend::type_text. Read more
Source§

impl Clone for LinuxBackend

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for LinuxBackend

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more