pub struct NativeBackend { /* private fields */ }Available on macOS and (Linux or macOS or Windows) 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 = CFRetained<AXUIElement>
type Handle = CFRetained<AXUIElement>
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 capture(
&self,
app: &AppInfo,
request: &CaptureRequest,
) -> Result<Capture<CFRetained<AXUIElement>>>
fn capture( &self, app: &AppInfo, request: &CaptureRequest, ) -> Result<Capture<CFRetained<AXUIElement>>>
Captures the app’s current window. Read more
Source§fn perform_action(
&self,
element: &CFRetained<AXUIElement>,
action: &str,
) -> Result<()>
fn perform_action( &self, element: &CFRetained<AXUIElement>, action: &str, ) -> Result<()>
Invokes a named accessibility action (as listed in
Action::name). Read moreSource§fn set_value(
&self,
element: &CFRetained<AXUIElement>,
value: &str,
) -> Result<()>
fn set_value( &self, element: &CFRetained<AXUIElement>, value: &str, ) -> Result<()>
Writes an element’s value. Read more
Source§fn value(&self, element: &CFRetained<AXUIElement>) -> Result<Option<String>>
fn value(&self, element: &CFRetained<AXUIElement>) -> Result<Option<String>>
Reads an element’s full, untruncated value. Read more
Source§fn select_text(
&self,
element: &CFRetained<AXUIElement>,
value: &str,
range: Range<usize>,
) -> Result<()>
fn select_text( &self, element: &CFRetained<AXUIElement>, 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 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