pub struct SemanticsDecoration {Show 38 fields
pub role: Option<SemanticsRole>,
pub label: Option<Arc<str>>,
pub role_description: Option<Arc<str>>,
pub test_id: Option<Arc<str>>,
pub value: Option<Arc<str>>,
pub disabled: Option<bool>,
pub read_only: Option<bool>,
pub required: Option<bool>,
pub invalid: Option<SemanticsInvalid>,
pub hidden: Option<bool>,
pub visited: Option<bool>,
pub multiselectable: Option<bool>,
pub busy: Option<bool>,
pub live: Option<Option<SemanticsLive>>,
pub live_atomic: Option<bool>,
pub selected: Option<bool>,
pub expanded: Option<bool>,
pub checked: Option<Option<bool>>,
pub placeholder: Option<Arc<str>>,
pub url: Option<Arc<str>>,
pub level: Option<u32>,
pub orientation: Option<SemanticsOrientation>,
pub numeric_value: Option<f64>,
pub min_numeric_value: Option<f64>,
pub max_numeric_value: Option<f64>,
pub numeric_value_step: Option<f64>,
pub numeric_value_jump: Option<f64>,
pub scroll_x: Option<f64>,
pub scroll_x_min: Option<f64>,
pub scroll_x_max: Option<f64>,
pub scroll_y: Option<f64>,
pub scroll_y_min: Option<f64>,
pub scroll_y_max: Option<f64>,
pub active_descendant_element: Option<u64>,
pub labelled_by_element: Option<u64>,
pub described_by_element: Option<u64>,
pub controls_element: Option<u64>,
pub invokable: Option<bool>,
}Expand description
Layout-transparent semantics overrides attached to an existing element (ADR 0222).
This is primarily intended for diagnostics and UI automation (test_id) and for restricted
a11y stamping on typed elements without introducing a layout wrapper.
use fret_core::SemanticsRole;
use fret_ui::element::SemanticsDecoration;
let decoration = SemanticsDecoration::default()
.role(SemanticsRole::Checkbox)
.label("Enable autosave")
.checked(Some(true))
.test_id("settings.autosave");
let el = some_element.attach_semantics(decoration);Fields§
§role: Option<SemanticsRole>§label: Option<Arc<str>>§role_description: Option<Arc<str>>Optional role description override (ARIA aria-roledescription-like outcome).
test_id: Option<Arc<str>>Debug/test-only identifier for deterministic automation.
This MUST NOT be mapped into platform accessibility name/label fields by default.
value: Option<Arc<str>>§disabled: Option<bool>§read_only: Option<bool>§required: Option<bool>§invalid: Option<SemanticsInvalid>§visited: Option<bool>§multiselectable: Option<bool>§busy: Option<bool>§live: Option<Option<SemanticsLive>>Live region setting (ARIA aria-live), applied as a semantics flags override.
Some(None) clears any live region semantics from the underlying element.
live_atomic: Option<bool>§selected: Option<bool>§expanded: Option<bool>§checked: Option<Option<bool>>Tri-state checked override (Some(None) clears; Some(Some(v)) sets to v).
placeholder: Option<Arc<str>>§url: Option<Arc<str>>§level: Option<u32>Optional hierarchy level for outline/tree semantics (1-based).
orientation: Option<SemanticsOrientation>§numeric_value: Option<f64>§min_numeric_value: Option<f64>§max_numeric_value: Option<f64>§numeric_value_step: Option<f64>§numeric_value_jump: Option<f64>§scroll_x: Option<f64>§scroll_x_min: Option<f64>§scroll_x_max: Option<f64>§scroll_y: Option<f64>§scroll_y_min: Option<f64>§scroll_y_max: Option<f64>§active_descendant_element: Option<u64>Declarative-only: element ID of the active descendant for composite widgets.
labelled_by_element: Option<u64>Declarative-only: element ID of a node which labels this node (aria-labelledby).
described_by_element: Option<u64>Declarative-only: element ID of a node which describes this node (aria-describedby).
controls_element: Option<u64>Declarative-only: element ID of a node which this node controls (aria-controls).
invokable: Option<bool>Overrides whether this node supports the platform “invoke”/click action.
This is useful for modeling ARIA patterns like Radix Accordion’s aria-disabled trigger
state, where the element remains focusable but should not expose an “activate” action.
Implementations§
Source§impl SemanticsDecoration
impl SemanticsDecoration
pub fn role(self, role: SemanticsRole) -> Self
pub fn label(self, label: impl Into<Arc<str>>) -> Self
pub fn role_description(self, role_description: impl Into<Arc<str>>) -> Self
pub fn test_id(self, test_id: impl Into<Arc<str>>) -> Self
pub fn value(self, value: impl Into<Arc<str>>) -> Self
pub fn disabled(self, disabled: bool) -> Self
pub fn read_only(self, read_only: bool) -> Self
pub fn required(self, required: bool) -> Self
pub fn invalid(self, invalid: SemanticsInvalid) -> Self
pub fn visited(self, visited: bool) -> Self
pub fn multiselectable(self, multiselectable: bool) -> Self
pub fn busy(self, busy: bool) -> Self
pub fn live(self, live: Option<SemanticsLive>) -> Self
pub fn live_atomic(self, live_atomic: bool) -> Self
pub fn selected(self, selected: bool) -> Self
pub fn expanded(self, expanded: bool) -> Self
pub fn checked(self, checked: Option<bool>) -> Self
pub fn placeholder(self, placeholder: impl Into<Arc<str>>) -> Self
pub fn url(self, url: impl Into<Arc<str>>) -> Self
pub fn level(self, level: u32) -> Self
pub fn orientation(self, orientation: SemanticsOrientation) -> Self
pub fn numeric_value(self, value: f64) -> Self
pub fn numeric_range(self, min: f64, max: f64) -> Self
pub fn numeric_step(self, step: f64) -> Self
pub fn numeric_jump(self, jump: f64) -> Self
pub fn scroll_x(self, x: f64, min: f64, max: f64) -> Self
pub fn scroll_y(self, y: f64, min: f64, max: f64) -> Self
pub fn active_descendant_element(self, element: u64) -> Self
pub fn labelled_by_element(self, element: u64) -> Self
pub fn described_by_element(self, element: u64) -> Self
pub fn controls_element(self, element: u64) -> Self
pub fn invokable(self, invokable: bool) -> Self
Trait Implementations§
Source§impl Clone for SemanticsDecoration
impl Clone for SemanticsDecoration
Source§fn clone(&self) -> SemanticsDecoration
fn clone(&self) -> SemanticsDecoration
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more