pub struct NativeSnapshot {
pub found: bool,
pub role: Role,
pub label: Option<String>,
pub value: Option<String>,
pub identifier: Option<String>,
pub text: Option<String>,
pub number: Option<f64>,
pub checked: Option<bool>,
pub enabled: Option<bool>,
pub visible: Option<bool>,
pub frame: Option<Rect>,
}Expand description
A widget’s actual native state, read back from the platform by Toolkit::read_native
(docs/testing.md): what the widget itself shows and reports, independently of Day’s tree,
so a11y_audit and assert_native (§14.2) can diff it against Day’s expectation.
Two groups. The accessibility fields (role, label, value, identifier) are read
together and found says whether they were: found = false means the backend cannot read
its accessibility tree, and the audit skips the node. Every other field is read on its own,
and None means “not read”: the backend cannot read it, or it does not apply to this kind.
A reader never reports a field it did not take from the widget, so a None is a recorded
gap rather than a pass.
Fields§
§found: boolThe accessibility fields below were read.
role: RoleThe native role mapped back to Day’s Role (best-effort).
label: Option<String>The accessibility label the platform reports.
value: Option<String>The accessibility value the platform reports.
identifier: Option<String>The automation identifier, which Day sets from .id().
text: Option<String>The text the widget displays: a label’s string, a button’s title, a text field’s or
text area’s contents, without markup or mnemonic markers. None for a secure field
that masks it.
number: Option<f64>A slider’s or progress indicator’s value, in the range Day gave it.
checked: Option<bool>A toggle’s state, or a button’s selected state (ButtonProps::selected).
enabled: Option<bool>Whether the widget takes input.
visible: Option<bool>Whether the widget is shown: not hidden itself, nor by an ancestor.
frame: Option<Rect>The widget’s frame in points, relative to the window’s content area, origin top left.
Trait Implementations§
Source§impl Clone for NativeSnapshot
impl Clone for NativeSnapshot
Source§fn clone(&self) -> NativeSnapshot
fn clone(&self) -> NativeSnapshot
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more