HitTester

Struct HitTester 

Source
pub struct HitTester { /* private fields */ }
Expand description

Hit tester for finding accessible elements at a point.

Implementations§

Source§

impl HitTester

Source

pub fn new() -> Self

Create a new hit tester.

Source

pub fn with_tree(tree: AccessibilityTree) -> Self

Create a hit tester with an existing tree.

Source

pub fn tree(&self) -> &AccessibilityTree

Get the underlying tree.

Source

pub fn tree_mut(&mut self) -> &mut AccessibilityTree

Get mutable access to the tree.

Source

pub fn hit_test(&self, point: Point) -> Option<&AccessibleNode>

Find the deepest accessible element at the given point.

Source

pub fn hit_test_id(&self, point: Point) -> Option<AccessibleNodeId>

Find the ID of the deepest accessible element at the given point.

Source

pub fn hit_test_all(&self, point: Point) -> Vec<&AccessibleNode>

Find all accessible elements at the given point (from topmost to root).

Source

pub fn hit_test_all_ids(&self, point: Point) -> Vec<AccessibleNodeId>

Find all element IDs at the given point.

Source

pub fn hit_test_focusable(&self, point: Point) -> Option<&AccessibleNode>

Find the first focusable element at the given point.

Source

pub fn hit_test_role( &self, point: Point, role: AccessibleRole, ) -> Vec<&AccessibleNode>

Find all elements with a specific role at the given point.

Trait Implementations§

Source§

impl Debug for HitTester

Source§

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

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

impl Default for HitTester

Source§

fn default() -> HitTester

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

Auto Trait Implementations§

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.