pub struct SemanticsUpdate {
pub nodes: Vec<(NodeId, Node)>,
pub root: NodeId,
pub focus: Option<NodeId>,
}Expand description
A collected accessibility tree produced by
RenderRoot::semantics.
nodes is the flat (NodeId, Node) map every accesskit platform adapter
consumes; root is the id of the enclosing window node (always present, even
for an empty tree); focus is the node a focused widget claimed via
SemanticsCtx::set_focused, or None when nothing in the tree is focused
(a platform adapter defaults the platform focus to root in that case).
Fields§
§nodes: Vec<(NodeId, Node)>The flat node map, root first, then each contributed node in the order it was collected (pre-order, mirroring paint).
root: NodeIdThe id of the root (window) node.
focus: Option<NodeId>The focused node, if any widget claimed focus this pass.
Implementations§
Source§impl SemanticsUpdate
impl SemanticsUpdate
Sourcepub fn focus_id(&self) -> NodeId
pub fn focus_id(&self) -> NodeId
The node a platform adapter should report as focused — the focused widget’s
node, or root when nothing in the tree is
focused.
accesskit’s TreeUpdate::focus is a non-optional NodeId: an adapter
must always name some focus target, and the window root is the
conventional fallback. This is the value a shell feeds
straight into the adapter, versus reading focus
when it needs to distinguish “root, because focused” from “root, because
nothing is focused”.
Trait Implementations§
Source§impl Clone for SemanticsUpdate
impl Clone for SemanticsUpdate
Source§fn clone(&self) -> SemanticsUpdate
fn clone(&self) -> SemanticsUpdate
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SemanticsUpdate
impl Debug for SemanticsUpdate
Source§impl PartialEq for SemanticsUpdate
impl PartialEq for SemanticsUpdate
impl StructuralPartialEq for SemanticsUpdate
Auto Trait Implementations§
impl Freeze for SemanticsUpdate
impl RefUnwindSafe for SemanticsUpdate
impl Send for SemanticsUpdate
impl Sync for SemanticsUpdate
impl Unpin for SemanticsUpdate
impl UnsafeUnpin for SemanticsUpdate
impl UnwindSafe for SemanticsUpdate
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.