Skip to main content

LinuxDesktopBackend

Struct LinuxDesktopBackend 

Source
pub struct LinuxDesktopBackend;
Expand description

Linux desktop backend. Methods are implemented in this module.

Trait Implementations§

Source§

impl Clone for LinuxDesktopBackend

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 Copy for LinuxDesktopBackend

Source§

impl Debug for LinuxDesktopBackend

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for LinuxDesktopBackend

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl DesktopBackend for LinuxDesktopBackend

Source§

fn screenshot(&self, region: Option<Region>) -> Result<Frame, ComputerError>

Capture the desktop, or a logical region of it, as RGBA pixels.
Source§

fn move_mouse(&self, x: i32, y: i32) -> Result<(), ComputerError>

Move the pointer without clicking.
Source§

fn simulate_click( &self, x: i32, y: i32, button: MouseButton, ) -> Result<(), ComputerError>

Move the pointer to (x, y) and click once.
Source§

fn simulate_type(&self, text: &str) -> Result<(), ComputerError>

Type Unicode text into the focused control.
Source§

fn simulate_key( &self, modifiers: &[Modifier], key: &str, ) -> Result<(), ComputerError>

Press modifiers, tap key, then release the modifiers. Read more
Source§

fn simulate_scroll(&self, dx: i32, dy: i32) -> Result<(), ComputerError>

Scroll by wheel steps. Positive dy scrolls down. Positive dx scrolls right.
Source§

fn cursor_position(&self) -> Result<(i32, i32), ComputerError>

Current pointer position in logical pixels.
Source§

fn list_displays(&self) -> Result<Vec<DisplayInfo>, ComputerError>

Connected displays. Does not capture pixels.
Source§

fn display_block(&self) -> Option<ComputerError>

Locked, asleep, or no display. None when capture may proceed. Read more
Source§

fn frontmost(&self) -> FrontmostInfo

Frontmost application and window. Never panics; missing data is None.
Source§

fn inspect_accessibility( &self, app_name: Option<&str>, ) -> Result<String, ComputerError>

Accessibility tree as a JSON string, when the platform can produce one.
Source§

fn list_apps(&self, all: bool) -> Result<Vec<AppInfo>, ComputerError>

Running applications. all includes accessory and prohibited apps.
Source§

fn list_windows(&self) -> Result<WindowList, ComputerError>

On-screen windows in z-order. Index 0 is front.
Source§

fn launch(&self, app: &str) -> Result<LaunchResult, ComputerError>

Launch an application by name, bundle id, or path.
Source§

fn activate( &self, app: &str, window: Option<&str>, ) -> Result<LaunchResult, ComputerError>

Bring an application forward. window selects a window inside it.
Source§

fn quit(&self, app: &str, force: bool) -> Result<QuitResult, ComputerError>

Ask an application to quit. force uses a forced terminate where the OS has one.
Source§

fn doctor(&self, options: DoctorOptions) -> Result<DoctorReport, ComputerError>

Permission probe. options.prompt may show a system prompt on macOS. Read more
Source§

fn tree(&self, query: &TreeQuery) -> Result<TreeReport, ComputerError>

Numbered accessibility tree for the key window.
Source§

fn end_session(&self, session: Option<&str>) -> Result<Vec<i32>, ComputerError>

Restore accessibility flags recorded for session. Read more
Source§

fn element_action( &self, request: &ElementRequest, ) -> Result<ElementOutcome, ElementError>

Press, focus, set a value, select text, perform an action, scroll, or type into one cached element. The element is revalidated before the action.
Source§

fn perform_input(&self, job: &InputJob) -> Result<InputReport, ComputerError>

Run one input tier. The default posts nothing. Read more
Source§

fn capture_screen( &self, region: Option<Region>, ) -> Result<RawCapture, ComputerError>

Desktop or region capture plus the map inputs (origin and logical size).
Source§

fn capture_window( &self, target: &WindowTarget, ) -> Result<RawCapture, ComputerError>

Capture one window. macOS uses ScreenCaptureKit. Other platforms crop the desktop image when the bounds are known.
Source§

fn menu_list( &self, _app: &str, _depth: u32, ) -> Result<MenuListReport, ComputerError>

Walk app’s menu bar. The macOS backend uses AXMenuBar -> AXMenuBarItem -> AXMenu. Other platforms return unsupported. depth caps recursion; out-of-depth submenus are reported as a single placeholder child.
Source§

fn menu_click( &self, _app: &str, _path: &MenuPath, ) -> Result<MenuClickReport, ComputerError>

Press one menu item by ">"-separated titles. A miss is element_not_found. A disabled item is execution_failed.
Source§

fn apple_event( &self, _app: &str, _script: &str, _language: AppleEventLanguage, ) -> Result<AppleEventReport, ComputerError>

Run an Apple event via osascript. macOS only. script is the body passed with -e; it never goes through a shell. The script body is never logged verbatim; only its byte count and SHA-256 are recorded.
Source§

fn dock_list(&self) -> Result<DockListReport, ComputerError>

List Dock items. macOS only.
Source§

fn dock_click(&self, _title: &str) -> Result<DockClickReport, ComputerError>

Click a Dock item by title. macOS only. A miss is element_not_found.
Source§

fn spaces(&self) -> Result<SpacesReport, ComputerError>

Group on-screen windows by the screen that contains each window’s center. Mission Control moves are not attempted; the skylight feature, when active, may opt into best-effort space moves.
Source§

fn browser_url(&self, pid: i32) -> Result<Option<String>, ComputerError>

Page URL for a browser process. Ok(None) when the platform has no URL. Read more
Source§

fn peek_element( &self, app: Option<&str>, window: Option<&str>, session: Option<&str>, index: u32, ) -> Result<Option<ElementPeek>, ComputerError>

Title and secure bit of a cached element. Ok(None) when it is not cached. Read more
Source§

fn user_input_pause_warning(&self) -> Option<&'static str>

Install the listen-only user-input tap when this process should pause. Read more
Source§

fn hit_test(&self, x: i32, y: i32) -> Result<Option<HitInfo>, ComputerError>

Hit-test a screen point. macOS reports the element under the point. Other platforms return Ok(None) and the coordinate click still runs.
Source§

fn input_support(&self) -> Capabilities

Whether background event posting exists. The stub overrides this.
Source§

fn marks_for_tree( &self, _query: &TreeQuery, _map: &ScreenshotMap, ) -> Result<Vec<MarkBox>, ComputerError>

Walk the latest tree and return rectangles in image pixels plus the label to draw (n for tree index). The screenshot command uses these for the --marks overlay. Read more
Source§

fn recognize_text( &self, _image: &RgbaImage, _map: &ScreenshotMap, ) -> Result<OcrResult, ComputerError>

Run OCR on one captured image and return the redacted, screen-remapped blocks. image is the prepared shot’s pixels.
Source§

fn secure_ocr_frames( &self, _query: &TreeQuery, _map: &ScreenshotMap, ) -> Result<Vec<ImageRect>, ComputerError>

Image-pixel rectangles of every secure element in the latest tree. The OCR dispatcher drops recognized text whose block falls inside any of these rectangles. The default returns an empty list, which matches every non-macOS platform and the mock backend. Read more
Source§

fn clipboard_get(&self) -> Result<ClipboardContents, ComputerError>

Read the clipboard. The default uses the system pasteboard outside tests. Read more
Source§

fn clipboard_set_text(&self, text: &str) -> Result<(), ComputerError>

Write clipboard text. Empty text is refused before this is called.
Source§

fn clipboard_set_image( &self, width: u32, height: u32, rgba: &[u8], ) -> Result<(), ComputerError>

Write an RGBA image to the clipboard.
Source§

fn release_held(&self) -> Result<(), ComputerError>

Release mouse buttons and keys this process still holds. 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> NoneValue for T
where T: Default,

Source§

type NoneType = T

Source§

fn null_value() -> T

The none-equivalent value.
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