Skip to main content

AppExt

Trait AppExt 

Source
pub trait AppExt: Sized {
    // Required methods
    fn by_name(name: &str, timeout: Duration) -> Result<Self>;
    fn by_pid(pid: u32, timeout: Duration) -> Result<Self>;
    fn list() -> Result<Vec<Self>>;
}
Expand description

Extension trait that adds singleton-based constructors to App.

Imported automatically via use xa11y::*.

§Example

use std::time::Duration;
use xa11y::*;

let app = App::by_name("Safari", Duration::from_secs(5))?;

Required Methods§

Source

fn by_name(name: &str, timeout: Duration) -> Result<Self>

Find an application by exact name using the global singleton provider, polling until it appears or timeout elapses. Pass Duration::ZERO for a single attempt with no waiting. See App::by_name_with for retry semantics.

Source

fn by_pid(pid: u32, timeout: Duration) -> Result<Self>

Find an application by process ID using the global singleton provider, polling until it appears or timeout elapses. See by_name for retry semantics.

Source

fn list() -> Result<Vec<Self>>

List all running applications using the global singleton provider.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§