Skip to main content

SemanticsDecoration

Struct SemanticsDecoration 

Source
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>§hidden: Option<bool>§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

Source

pub fn merge(self, other: Self) -> Self

Merges two decorations, with other taking precedence.

Source

pub fn role(self, role: SemanticsRole) -> Self

Source

pub fn label(self, label: impl Into<Arc<str>>) -> Self

Source

pub fn role_description(self, role_description: impl Into<Arc<str>>) -> Self

Source

pub fn test_id(self, test_id: impl Into<Arc<str>>) -> Self

Source

pub fn value(self, value: impl Into<Arc<str>>) -> Self

Source

pub fn disabled(self, disabled: bool) -> Self

Source

pub fn read_only(self, read_only: bool) -> Self

Source

pub fn required(self, required: bool) -> Self

Source

pub fn invalid(self, invalid: SemanticsInvalid) -> Self

Source

pub fn hidden(self, hidden: bool) -> Self

Source

pub fn visited(self, visited: bool) -> Self

Source

pub fn multiselectable(self, multiselectable: bool) -> Self

Source

pub fn busy(self, busy: bool) -> Self

Source

pub fn live(self, live: Option<SemanticsLive>) -> Self

Source

pub fn live_atomic(self, live_atomic: bool) -> Self

Source

pub fn selected(self, selected: bool) -> Self

Source

pub fn expanded(self, expanded: bool) -> Self

Source

pub fn checked(self, checked: Option<bool>) -> Self

Source

pub fn placeholder(self, placeholder: impl Into<Arc<str>>) -> Self

Source

pub fn url(self, url: impl Into<Arc<str>>) -> Self

Source

pub fn level(self, level: u32) -> Self

Source

pub fn orientation(self, orientation: SemanticsOrientation) -> Self

Source

pub fn numeric_value(self, value: f64) -> Self

Source

pub fn numeric_range(self, min: f64, max: f64) -> Self

Source

pub fn numeric_step(self, step: f64) -> Self

Source

pub fn numeric_jump(self, jump: f64) -> Self

Source

pub fn scroll_x(self, x: f64, min: f64, max: f64) -> Self

Source

pub fn scroll_y(self, y: f64, min: f64, max: f64) -> Self

Source

pub fn active_descendant_element(self, element: u64) -> Self

Source

pub fn labelled_by_element(self, element: u64) -> Self

Source

pub fn described_by_element(self, element: u64) -> Self

Source

pub fn controls_element(self, element: u64) -> Self

Source

pub fn invokable(self, invokable: bool) -> Self

Trait Implementations§

Source§

impl Clone for SemanticsDecoration

Source§

fn clone(&self) -> SemanticsDecoration

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SemanticsDecoration

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SemanticsDecoration

Source§

fn default() -> SemanticsDecoration

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more