AccessibilityTree

Struct AccessibilityTree 

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

Accessibility tree for hit testing and navigation.

Implementations§

Source§

impl AccessibilityTree

Source

pub fn new() -> Self

Create a new empty accessibility tree.

Source

pub fn next_id(&mut self) -> AccessibleNodeId

Generate a new unique node ID.

Source

pub fn set_root(&mut self, id: AccessibleNodeId)

Set the root node.

Source

pub fn root(&self) -> Option<&AccessibleNode>

Get the root node.

Source

pub fn get(&self, id: AccessibleNodeId) -> Option<&AccessibleNode>

Get a node by ID.

Source

pub fn get_mut(&mut self, id: AccessibleNodeId) -> Option<&mut AccessibleNode>

Get a mutable node by ID.

Source

pub fn insert(&mut self, node: AccessibleNode)

Insert a node into the tree.

Source

pub fn remove(&mut self, id: AccessibleNodeId) -> Option<AccessibleNode>

Remove a node from the tree.

Source

pub fn len(&self) -> usize

Get the number of nodes in the tree.

Source

pub fn is_empty(&self) -> bool

Check if the tree is empty.

Source

pub fn clear(&mut self)

Clear all nodes from the tree.

Source

pub fn focused(&self) -> Option<&AccessibleNode>

Get the currently focused node.

Source

pub fn focused_id(&self) -> Option<AccessibleNodeId>

Get the currently focused node ID.

Source

pub fn set_focus(&mut self, id: AccessibleNodeId) -> bool

Set focus to a node.

Source

pub fn clear_focus(&mut self)

Clear focus.

Source

pub fn focus_next(&mut self) -> Option<AccessibleNodeId>

Move focus to the next focusable element.

Source

pub fn focus_previous(&mut self) -> Option<AccessibleNodeId>

Move focus to the previous focusable element.

Source

pub fn get_focus_order(&mut self) -> &[AccessibleNodeId]

Get the focus order.

Trait Implementations§

Source§

impl Debug for AccessibilityTree

Source§

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

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

impl Default for AccessibilityTree

Source§

fn default() -> AccessibilityTree

Returns the “default value” for a type. 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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

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

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.