pub struct AccessibilityId(pub u64);Expand description
A stable identifier for accessibility nodes.
This ID is generated based on the component’s position in the tree and optional user-provided keys. It remains stable across frames as long as the UI structure doesn’t change.
Tuple Fields§
§0: u64Implementations§
Source§impl AccessibilityId
impl AccessibilityId
Sourcepub fn to_accesskit_id(self) -> AccessKitNodeId
pub fn to_accesskit_id(self) -> AccessKitNodeId
Converts to AccessKit’s NodeId.
Sourcepub fn from_accesskit_id(id: AccessKitNodeId) -> Self
pub fn from_accesskit_id(id: AccessKitNodeId) -> Self
Creates from AccessKit’s NodeId.
Sourcepub fn from_component_node_id(node_id: NodeId) -> Self
pub fn from_component_node_id(node_id: NodeId) -> Self
Generates a stable ID from an indextree NodeId.
indextree uses an arena-based implementation where NodeIds contain:
- A 1-based index into the arena
- A stamp for detecting node reuse
In Tessera’s immediate-mode model, the component tree is cleared and rebuilt each frame, so there’s no node reuse within a frame. This makes the index stable for the current tree state, which is exactly what AccessKit requires (IDs only need to be stable within the current tree).
§Stability Guarantee
The ID is stable within a single frame as long as the UI structure doesn’t change. This matches AccessKit’s requirement perfectly.
Trait Implementations§
Source§impl Clone for AccessibilityId
impl Clone for AccessibilityId
Source§fn clone(&self) -> AccessibilityId
fn clone(&self) -> AccessibilityId
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AccessibilityId
impl Debug for AccessibilityId
Source§impl Hash for AccessibilityId
impl Hash for AccessibilityId
Source§impl PartialEq for AccessibilityId
impl PartialEq for AccessibilityId
impl Copy for AccessibilityId
impl Eq for AccessibilityId
impl StructuralPartialEq for AccessibilityId
Auto Trait Implementations§
impl Freeze for AccessibilityId
impl RefUnwindSafe for AccessibilityId
impl Send for AccessibilityId
impl Sync for AccessibilityId
impl Unpin for AccessibilityId
impl UnwindSafe for AccessibilityId
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
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.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more