#[non_exhaustive]pub struct StateSet {Show 15 fields
pub enabled: bool,
pub visible: bool,
pub focused: bool,
pub active: bool,
pub minimized: Option<bool>,
pub maximized: Option<bool>,
pub fullscreen: Option<bool>,
pub checked: Option<Toggled>,
pub selected: bool,
pub expanded: Option<bool>,
pub editable: bool,
pub focusable: bool,
pub modal: bool,
pub required: bool,
pub busy: bool,
}Expand description
Boolean state flags for an element.
Semantics for non-applicable states: When a state doesn’t apply to an element’s role, the backend uses the platform’s reported value or defaults:
enabled:true(elements are enabled unless explicitly disabled)visible:true(elements are visible unless explicitly hidden/offscreen)focused,active,focusable,modal,selected,editable,required,busy:false
States that are inherently inapplicable use Option: checked is
None for non-checkable elements, expanded is None for
non-expandable elements. The window states (minimized, maximized,
fullscreen) are Option for a second reason: None also means
unknown — a platform that cannot read the state reports None
rather than a guessed false (Linux cannot report maximized or
fullscreen at all, and Windows cannot report fullscreen).
#[non_exhaustive]: more states arrive in compatible releases and must
not break readers. Providers building a complete state set use
[StateParts], which is exhaustive — the documented defaults above are
what a partial construction falls back to, not a licence for a
backend to skip deciding.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.enabled: bool§visible: bool§focused: bool§active: boolWhether this element is the active (foreground) window — the window that
currently receives the user’s input. Only meaningful for window-like
elements (windows, dialogs); false elsewhere. Distinct from focused,
which is element-level keyboard focus. Platform mappings: the AT-SPI
ACTIVE state (Linux), AXMain (macOS), and the foreground HWND
(Windows).
minimized: Option<bool>Whether the window is minimized (iconified).
None = unknown or not a window. Unlike enabled/visible, the
three window states are Option<bool> because None also means
“this platform cannot report the state”: Linux cannot read
maximized or fullscreen at all, and Windows cannot read fullscreen
(it reads minimized and maximized from
WindowPattern.CurrentWindowVisualState), so a hard-coded false
would be a silent guess.
maximized: Option<bool>Whether the window is maximized. None = unknown / not a window.
fullscreen: Option<bool>Whether the window is in fullscreen. None = unknown / not a window.
checked: Option<Toggled>None = not checkable
selected: bool§expanded: Option<bool>None = not expandable
editable: bool§focusable: boolWhether the element can receive keyboard focus
modal: boolWhether the element is a modal dialog
required: boolForm field required
busy: boolAsync operation in progress