pub struct A11yTree { /* private fields */ }Expand description
An insertion-ordered tree of semantic nodes.
Implementations§
Source§impl A11yTree
impl A11yTree
Sourcepub fn insert(&mut self, node: A11yNode) -> NodeId
pub fn insert(&mut self, node: A11yNode) -> NodeId
Insert a node; ids must be unique and ascending is conventional but not required. Returns the node’s id for chaining.
Sourcepub fn audit(&self) -> Result<TreeAudit, AuditError>
pub fn audit(&self) -> Result<TreeAudit, AuditError>
Audit the tree. Every rule is a CI gate:
- unique ids;
- parents and relation targets exist;
- no structural cycles;
- interactive roles carry an accessible name;
- at most one focused node, and it is reachable from a root.
Sourcepub fn reachable_from_roots(&self) -> Vec<NodeId>
pub fn reachable_from_roots(&self) -> Vec<NodeId>
Every node reachable by walking parents down from the roots.
Sourcepub fn children_of(&self, id: NodeId) -> Vec<NodeId>
pub fn children_of(&self, id: NodeId) -> Vec<NodeId>
Direct children of id.
Sourcepub fn descendants_of(&self, id: NodeId) -> Vec<NodeId>
pub fn descendants_of(&self, id: NodeId) -> Vec<NodeId>
id and every node beneath it (depth-first, parents first).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for A11yTree
impl RefUnwindSafe for A11yTree
impl Send for A11yTree
impl Sync for A11yTree
impl Unpin for A11yTree
impl UnsafeUnpin for A11yTree
impl UnwindSafe for A11yTree
Blanket Implementations§
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