Skip to main content

NativeSnapshot

Struct NativeSnapshot 

Source
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: bool

The accessibility fields below were read.

§role: Role

The 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

Source§

fn clone(&self) -> NativeSnapshot

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for NativeSnapshot

Source§

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

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

impl Default for NativeSnapshot

Source§

fn default() -> NativeSnapshot

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

impl PartialEq for NativeSnapshot

Source§

fn eq(&self, other: &NativeSnapshot) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for NativeSnapshot

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, 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.
Day API ↩ Guides· daybrite.dev