pub struct AccessibilityNode {Show 14 fields
pub role: Option<Role>,
pub label: Option<String>,
pub description: Option<String>,
pub value: Option<String>,
pub numeric_value: Option<f64>,
pub min_numeric_value: Option<f64>,
pub max_numeric_value: Option<f64>,
pub focusable: bool,
pub focused: bool,
pub toggled: Option<Toggled>,
pub disabled: bool,
pub hidden: bool,
pub actions: Vec<Action>,
pub key: Option<String>,
}Expand description
Semantic information for an accessibility node.
This structure contains all the metadata that assistive technologies need to understand and interact with a UI component.
Fields§
§role: Option<Role>The role of this node (button, text input, etc.)
label: Option<String>A human-readable label for this node
description: Option<String>A detailed description of this node
value: Option<String>The current value (for text inputs, sliders, etc.)
numeric_value: Option<f64>Numeric value (for sliders, progress bars, etc.)
min_numeric_value: Option<f64>Minimum numeric value
max_numeric_value: Option<f64>Maximum numeric value
focusable: boolWhether this node can receive focus
focused: boolWhether this node is currently focused
toggled: Option<Toggled>Toggled/checked state (for checkboxes, switches, radio buttons)
disabled: boolWhether this node is disabled
Whether this node is hidden from accessibility
actions: Vec<Action>Supported actions
key: Option<String>Custom accessibility key provided by the component
Implementations§
Source§impl AccessibilityNode
impl AccessibilityNode
Sourcepub fn with_label(self, label: impl Into<String>) -> Self
pub fn with_label(self, label: impl Into<String>) -> Self
Sets the label of this node.
Sourcepub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
Sets the description of this node.
Sourcepub fn with_value(self, value: impl Into<String>) -> Self
pub fn with_value(self, value: impl Into<String>) -> Self
Sets the value of this node.
Sourcepub fn with_numeric_value(self, value: f64) -> Self
pub fn with_numeric_value(self, value: f64) -> Self
Sets the numeric value of this node.
Sourcepub fn with_numeric_range(self, min: f64, max: f64) -> Self
pub fn with_numeric_range(self, min: f64, max: f64) -> Self
Sets the numeric range of this node.
Sourcepub fn with_toggled(self, toggled: Toggled) -> Self
pub fn with_toggled(self, toggled: Toggled) -> Self
Sets the toggled/checked state of this node.
Marks this node as hidden from accessibility.
Sourcepub fn with_action(self, action: Action) -> Self
pub fn with_action(self, action: Action) -> Self
Adds an action that this node supports.
Sourcepub fn with_actions(self, actions: impl IntoIterator<Item = Action>) -> Self
pub fn with_actions(self, actions: impl IntoIterator<Item = Action>) -> Self
Adds multiple actions that this node supports.
Trait Implementations§
Source§impl Clone for AccessibilityNode
impl Clone for AccessibilityNode
Source§fn clone(&self) -> AccessibilityNode
fn clone(&self) -> AccessibilityNode
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AccessibilityNode
impl Debug for AccessibilityNode
Source§impl Default for AccessibilityNode
impl Default for AccessibilityNode
Source§fn default() -> AccessibilityNode
fn default() -> AccessibilityNode
Auto Trait Implementations§
impl Freeze for AccessibilityNode
impl RefUnwindSafe for AccessibilityNode
impl Send for AccessibilityNode
impl Sync for AccessibilityNode
impl Unpin for AccessibilityNode
impl UnwindSafe for AccessibilityNode
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<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