pub struct LinuxBackend { /* private fields */ }Available on Linux only.
Expand description
The Linux implementation of Backend, built on AT-SPI.
Implementations§
Source§impl LinuxBackend
impl LinuxBackend
Sourcepub fn new() -> Result<Self>
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
impl Backend for LinuxBackend
Source§type Handle = LinuxElement
type Handle = LinuxElement
Handle to a live accessibility element (e.g.
AXUIElement, IUIAutomationElement).Source§fn list_apps(&self) -> Result<Vec<AppInfo>>
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>
fn launch_app(&self, app: &AppInfo) -> Result<AppInfo>
Starts
app without bringing it to the foreground and returns its running record. Read moreSource§fn list_windows(&self, app: &AppInfo) -> Result<Vec<WindowInfo>>
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 moreSource§fn capture(
&self,
app: &AppInfo,
request: &CaptureRequest,
) -> Result<Capture<Self::Handle>>
fn capture( &self, app: &AppInfo, request: &CaptureRequest, ) -> Result<Capture<Self::Handle>>
Captures the app’s current window, or the one
CaptureRequest::window names. Read moreSource§fn perform_action(&self, element: &Self::Handle, action: &str) -> Result<()>
fn perform_action(&self, element: &Self::Handle, action: &str) -> Result<()>
Invokes a named accessibility action (as listed in
Action::name). Read moreSource§fn set_value(&self, element: &Self::Handle, value: &str) -> Result<()>
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>>
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<()>
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 moreSource§fn click(
&self,
_target: InputTarget<'_>,
point: Point,
button: MouseButton,
count: u32,
) -> Result<()>
fn click( &self, _target: InputTarget<'_>, point: Point, button: MouseButton, count: u32, ) -> Result<()>
Clicks
count times at a screen point. Read moreSource§fn type_text(&self, _target: InputTarget<'_>, text: &str) -> Result<()>
fn type_text(&self, _target: InputTarget<'_>, text: &str) -> Result<()>
Types literal text. Read more
Source§fn press_key(&self, _target: InputTarget<'_>, chord: &KeyChord) -> Result<()>
fn press_key(&self, _target: InputTarget<'_>, chord: &KeyChord) -> Result<()>
Presses and releases a key chord. Read more
Source§fn permissions(&self) -> Permissions
fn permissions(&self) -> Permissions
Permissions currently held by this process.
Source§fn request_permissions(&self) -> Permissions
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>
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 moreSource§impl Clone for LinuxBackend
impl Clone for LinuxBackend
Auto Trait Implementations§
impl !RefUnwindSafe for LinuxBackend
impl !UnwindSafe for LinuxBackend
impl Forget for LinuxBackend
impl Freeze for LinuxBackend
impl Send for LinuxBackend
impl Sync for LinuxBackend
impl Unpin for LinuxBackend
impl UnsafeUnpin for LinuxBackend
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more