pub struct MacBackend { /* private fields */ }Available on macOS only.
Expand description
The macOS Backend.
Requires macOS 14 or later, and the Accessibility and Screen Recording permissions for the host process (usually the terminal or app that runs your binary).
Implementations§
Trait Implementations§
Source§impl Backend for MacBackend
impl Backend for MacBackend
Source§type Handle = MacElement
type Handle = MacElement
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 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 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<MacElement>>
fn capture( &self, app: &AppInfo, request: &CaptureRequest, ) -> Result<Capture<MacElement>>
Captures the app’s current window, or the one
CaptureRequest::window names. Read moreSource§fn perform_action(&self, element: &MacElement, action: &str) -> Result<()>
fn perform_action(&self, element: &MacElement, action: &str) -> Result<()>
Invokes a named accessibility action (as listed in
Action::name). Read moreSource§fn set_value(&self, element: &MacElement, value: &str) -> Result<()>
fn set_value(&self, element: &MacElement, value: &str) -> Result<()>
Writes an element’s value. Read more
Source§fn value(&self, element: &MacElement) -> Result<Option<String>>
fn value(&self, element: &MacElement) -> Result<Option<String>>
Reads an element’s full, untruncated value. Read more
Source§fn select_text(
&self,
element: &MacElement,
value: &str,
range: Range<usize>,
) -> Result<()>
fn select_text( &self, element: &MacElement, 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 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§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§impl Debug for MacBackend
impl Debug for MacBackend
Auto Trait Implementations§
impl !Freeze for MacBackend
impl Forget for MacBackend
impl RefUnwindSafe for MacBackend
impl Send for MacBackend
impl Sync for MacBackend
impl Unpin for MacBackend
impl UnsafeUnpin for MacBackend
impl UnwindSafe for MacBackend
Blanket Implementations§
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
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